Warning for bad word - spam problem [REP+]
#1

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);
		}
	}
Reply
#2

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;
}
Reply
#3

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+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)