Anti flood not working
#1

Could someone help me find the problem in my antiflood lines under playertext basicly when typed a command over 10 times it still doesnt give the warning nor kick you.

Код:
	if(Text[playerid] >= 1 && AntiSpam == 1)
	{
	    KillTimer(TextTimer[playerid]);
		TextTimer[playerid] = SetTimerEx("ResetText",1500,false,"i",playerid);
	}
	if(Text[playerid] == 5 && AntiSpam == 1) SendClientMessage(playerid, COLOR_LIGHTBLUE,"* Slow it down or you will be kicked!");
	if(Text[playerid] == 10 && AntiSpam == 1)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
		SCM(playerid,COLOR_LIGHTBLUE, "You have been Kicked by The Anticheat For Flooding the chat.");
		format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for: Flooding the chat.",d,m,y,h,mi,s,sendername);
		KickLog(string);
		format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by the Anticheat - Flooding the chat.",d,m,y,h,mi,s,sendername);
		AddPunishment(playerid, string);
		ServerKick(playerid);
		KillTimer(TextTimer[playerid]);
	}
Reply
#2

maybe some defines are wrong.
Reply
#3

The define is new Text[MAX_PLAYERS]; Text[playerid], < under onplayerconnect
Reply
#4

Код:
new XDeaths[MAX_PLAYERS];
new LastDeath[MAX_PLAYERS];
new Text:TD;
Код:
 if(XDeaths[playerid] == 0)
    {
       LastDeath[playerid] = gettime();
    }
    XDeaths[playerid]++;
    if(XDeaths[playerid] == 5)
    {
        if((gettime() - LastDeath[playerid]) <= 5)
        {
            SendClientMessage(playerid,0,"{0CFA00} You have been banned, for floodcheck ");
            BanEx(playerid,"Banned for FakeKill Flood");
        }
        else
        {
            if((gettime() - LastDeath[playerid]) > 5)
            {
                XDeaths[playerid]=0;
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)