Работает, но если слабый флуд делать, то не срабатывает. Это античит на фейк кил.
Код
#include <a_samp>
#define KILL_LIMIT 4 //kills on 1 sec.
enum DeathEnum
{
time,
killed
};
new DeathInfo[MAX_PLAYERS][DeathEnum];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Anty-Fake kill for pawno.cz");
print("--------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
DeathInfo[playerid][time] = 0;
DeathInfo[playerid][killed] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if((gettime() - DeathInfo[playerid][time]) < 1)
{
DeathInfo[playerid][killed]++;
if(DeathInfo[playerid][killed] == KILL_LIMIT)
{
//new msg[126];
//format(msg,sizeof(msg),"Player: %d performs FakeKille!",playerid);
//SendClientMessageToAll(-1,msg);
SendClientMessage(playerid,-1,"You are banned from this server! Reason: FakeKilling");
BanEx(playerid,"FakeKill");
}
}
else DeathInfo[playerid][killed] = 0;
DeathInfo[playerid][time] = gettime();
return 1;
}