08.09.2011, 20:48
Quote:
+1. Where is it doing something with the text[] parameter of OnPlayerText? It doesn't get processed, Meaning it doesn't even modify the player's message... So, how can it censor stuff?
|
pawn Код:
#define DisableBadword(%1) for(new i=0; i<strlen(text); i++) if(strfind(text[i], %1, true) == 0) for(new a=0; a<256; a++) if (a >= i && a < i+strlen(%1)) text[a]='*'
For you to see that it works:
![](/imageshack/img268/2594/unledtel.png)
EDIT 2:
Here is my command
pawn Код:
CMD:forbidword(playerid,params[])
{
if(PInfo[playerid][Level] < 3) return SendNeedLevel(playerid,3);
new word[20],tempstr[23];
if(sscanf(params,"s",word)) return SendClientMessage(playerid,green2,"USAGE: /forbidword "cyellow"<word>");
new File:Forbidenwordsfile;
Forbidenwordsfile = fopen("FAdmin/Logs/Forbidenwords.txt", io_append);
format(tempstr,sizeof(tempstr),"%s\n",word);
fwrite(Forbidenwordsfile, tempstr);
fclose(Forbidenwordsfile);
LoadForbidenWords();
return 1;
}