PHP код:
public OnPlayerText(playerid, text[])
{
static LastText[MAX_PLAYERS][128];
if(strfind(LastText[playerid], text, false) != -1) return SendClientMessage(playerid, COLOR_RED, "<!>Don't spam!"), 0;
strmid(LastText[playerid], text, 0, strlen(text), sizeof(LastText[]));
new
badWords[][] =
{
"bitch",
"ass",
"fuck",
"nigger",
"nigga",
"jew",
"retard",
"whore",
"hoe",
"negro",
"chongo",
"nazzi",
"noob",
"motherfucker",
"pussy",
"puto"
}
;
for(new i; i != sizeof(badWords); ++i)
{
replaceSwear(text, badWords[i]);
}
return 0;
}
stock replaceSwear(string[], badWord[], replace = '*')
{
new
i
;
while((i = strfind(string, badWord, true)) != -1)
{
for(new x = (i + strlen(badWord)); i != x; ++i)
{
string[i] = replace;
}
}
return 1;
}
Commands are working fine but each time I try to use chat it just doesnt display the message
Resolved, there was problem with something else. Thanks anyway