11.01.2015, 05:03
Help me how to stop fake killing in my server.
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
//Defines:
#undef MAX_PLAYERS
#define MAX_PLAYERS 200 //Change this
//-------------------
#define Rot 0xFF000000
#define Weiss 0xFFFFFFFF
//-------------------
#define HOMEPAGE "www.Your-Homepage.com"
#define ADMINNAME "Server"
//-------------------
#define Kickplayer //Comment out if players should be banned. (If not, players will only be kicked!)
//Variables:
new AntiFakekill[MAX_PLAYERS];
//new GodCar[MAX_PLAYERS];
//Forwards:
forward AntiFakekillTimer(playerid);
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
AntiFakekill[playerid]++;
SetTimerEx("AntiFakekillTimer", 1000,false,"i",playerid);
//SendDeathMessage(killerid,playerid,reason);
return 1;
}
public AntiFakekillTimer(playerid)
{
AntiFakekill[playerid]--;
if(AntiFakekill[playerid] > 2)
{
BanEx(playerid,"Anti Fake Kill");
}
return 1;
}
if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1)
{
Kick(playerid);
}
SetPVarInt(playerid,"PlayerLastDeath",gettime());