09.01.2016, 12:22
I'm currently editing my @OnPlayerText callback and I need some support.
Its about inappropriate words...
@OnPlayerText CODE:
The problem is when I test this anti swear system only the 1st word actually gets blocked and the others don't.
InappropriateWords:
EDIT: + No errors.
Its about inappropriate words...
@OnPlayerText CODE:
PHP код:
for(new psovka; psovka < sizeof(NeprikladneRijeci); psovka++)
{
if(PlayerInfo[playerid][pAdministrator] == 0 && PlayerInfo[playerid][pSupporter] == 0)
{
if(strfind(text,NeprikladneRijeci[psovka],true) != -1)
{
SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Upisali ste neprikladnu rijec i ona se nece pojaviti u chatu.");
format(poruka,256,"{FF0000}[A-INFO]:{FFFFFF} %s je upisao neprikladnu rijec: '%s'",GetName(playerid),text);
SendAdminMessage(-1,poruka);
return 0;
}
else
{
format(poruka,256,"{FF8000}%s{C0C0C0} kaze:{FFFFFF} %s",GetName(playerid),text);
SendNearMessage(playerid,20.0,-1,poruka);
return 0;
}
}
//
if(PlayerInfo[playerid][pSupporter] > 0)
{
if(strfind(text,NeprikladneRijeci[psovka],true) != -1)
{
SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Upisali ste neprikladnu rijec i ona se nece pojaviti u chatu.");
format(poruka,256,"{FF0000}[A-INFO]: %s %s je upisao neprikladnu rijec: '%s'",GetPlayerSupporterRank(playerid),GetName(playerid),text);
SendAdminMessage(-1,poruka);
return 0;
}
else
{
format(poruka,256,"{FFFF00}%s{FFFFFF} kaze:{FFFF00} %s",GetName(playerid),text);
SendNearMessage(playerid,20.0,-1,poruka);
return 0;
}
}
}
InappropriateWords:
PHP код:
new NeprikladneRijeci[] =
{
"kurac", // This one works. It means penis on English.
"smrad",
"govno",
"drek",
"picka",
"sisa",
"pizdo",
"jebo te",
"jebote",
"jebi se",
"sisaj mi kurac",
"pusi kurac",
"jebem ti mater",
"jebem ti sve",
"picka ti materina",
"cigane",
"idiot",
"kreten",
"moron",
"debil",
"nabijem te",
"mrs",
"odjebi",
"sranje",
"budala",
"ddos",
"kurcina",
"smrdo"
};