Hello everyone! thanks for stopping by. I have zero source/programing knowledge but I was able to make this code to work (yes, it works), but there are two things bothering me:
the clif->ShowScript part works but its throw a warning when compiling
the warning is:
Quote
warning C4133: 'function': incompatible types - from 'map_session_data *' to 'block_list *'
the return retVal; that I commented out and changed it to return true;, is it okay? I made these changes to old code following these changes to make the code work on newer hercules
(yes I know I can ignore warnings, but maybe its something really easy that I'm missing and can be fixed)
this is the code:
bool filter_chat(struct map_session_data **sd,constchar**message_){constchar* message =*message_;unsignedint i;char output[254];// Compiler supposed to reuse the pre-allocated space but who knows, those few bytes doesn't worth lowering the speed.if(!message)returnfalse;if(!mannersize || pc_has_permission(*sd, bypass_chat_filter)||!pc->can_talk(*sd))//return retVal;returntrue;for(i =0; i < mannersize;++i){if(libpcre->exec(mannerlist[i].regex, mannerlist[i].extra, message,(int)strlen(message),0,0, NULL,0)!= PCRE_ERROR_NOMATCH){
sprintf(output,"i've been saying bad stuff");
clif->messagecolor_self((*sd)->fd, COLOR_RED, output);
clif->ShowScript(*sd,"watch out for your mouth", AREA);
hookStop();returnfalse;}}returntrue;}
Hello everyone! thanks for stopping by. I have zero source/programing knowledge but I was able to make this code to work (yes, it works), but there are two things bothering me:
the warning is:
(yes I know I can ignore warnings, but maybe its something really easy that I'm missing and can be fixed)
this is the code:
its part of this plugin (the lite version)
Share this post
Link to post
Share on other sites