Warning for bad word - spam problem [REP+] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Warning for bad word - spam problem [REP+] (
/showthread.php?tid=568581)
Warning for bad word - spam problem [REP+] -
TiXz0r - 23.03.2015
I dont know, how to fix spam.
When type bad word like: fuc*, send 1 msg for chat warning.
but when type two bad words like: fuc* gay, send two chat warnings to admins.
I want just one chat warning to admins.
Thanks.
Код:
for(new i; i < sizeof(ZabranjeneRijeci); i++)
{
if(strfind(text, ZabranjeneRijeci[i], true) != -1)
{
new zrstring[128];
format(zrstring, sizeof(zrstring), "[CHAT-WARNING]: "COL_GREY"(%d)%s: %s", playerid,GetName(playerid),text);
SendMessageToStaff(COLOR_PURPLE, zrstring);
}
}
Re: Warning for bad word - spam problem [REP+] -
CalvinC - 23.03.2015
You could do this:
pawn Код:
new bool:Sweared;
for(new i; i < sizeof(ZabranjeneRijeci); i++)
{
if(strfind(text, ZabranjeneRijeci[i], true) != -1)
{
Sweared = true;
}
}
if(Sweared)
{
new zrstring[128];
format(zrstring, sizeof(zrstring), "[CHAT-WARNING]: "COL_GREY"(%d)%s: %s", playerid,GetName(playerid),text);
SendMessageToStaff(COLOR_PURPLE, zrstring);
Sweared = false;
}
Re: Warning for bad word - spam problem [REP+] -
TiXz0r - 23.03.2015
Quote:
Originally Posted by CalvinC
You could do this:
pawn Код:
new bool:Sweared; for(new i; i < sizeof(ZabranjeneRijeci); i++) { if(strfind(text, ZabranjeneRijeci[i], true) != -1) { Sweared = true; } } if(Sweared) { new zrstring[128]; format(zrstring, sizeof(zrstring), "[CHAT-WARNING]: "COL_GREY"(%d)%s: %s", playerid,GetName(playerid),text); SendMessageToStaff(COLOR_PURPLE, zrstring); Sweared = false; }
|
working. thanks. rep+