inappropriate words -
NoDi522 - 09.01.2016
I'm currently editing my @OnPlayerText callback and I need some support.
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;
}
}
}
The problem is when I test this anti swear system only the 1st word actually gets blocked and the others don't.
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"
};
EDIT: + No errors.
Re: inappropriate words -
xTURBOx - 09.01.2016
what seems to be ur problem?
Re: inappropriate words -
NoDi522 - 09.01.2016
The problem is when I test this anti swear system only the 1st word actually gets blocked and the others don't.
EDIT: read more carefully.
Re: inappropriate words -
Virtual1ty - 09.01.2016
It is because of the "return" statement in your loop.
Re: inappropriate words -
GTLS - 09.01.2016
well, in my RP server i am using this under OnPlayerText:
PHP код:
if(strfind(text, "lol", true) != -1) {
GivePlayerCash(playerid, -10000);
format(string,sizeof(string), "Admin: %s[ID %d} was fined $10000 by Anti-Cheat: using 'lol' in IC Chat", GetPlayerNameEx(playerid),playerid);
SendClientMessageToAll(COLOR_LIGHTRED, string);
return 0;
}
in place of my code, you can use what you want like ProxDetector with empty String to hide full message etc..
Hope it gave you some idea
Re: inappropriate words -
NoDi522 - 09.01.2016
Quote:
Originally Posted by Virtual1ty
It is because of the "return" statement in your loop.
|
Can you explain a bit more?
EDIT: Thanks for support GTLS