SA-MP Forums Archive
Anti flood not working - 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: Anti flood not working (/showthread.php?tid=531008)



Anti flood not working - devil shill - 10.08.2014

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]);
	}



Re: Anti flood not working - PawnOX - 10.08.2014

maybe some defines are wrong.


Re: Anti flood not working - devil shill - 10.08.2014

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


Re: Anti flood not working - Spartaaaaa - 11.08.2014

Код:
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;
}