Really need anti fake kill. - 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: Really need anti fake kill. (
/showthread.php?tid=568435)
Really need anti fake kill. -
VenomMancer - 22.03.2015
Hello guys. i have make FR server from 2 years ago.
but my problem is still same, and its called 'Fake kill' from hackers.
Who have, or can make for me anti fake kill ?
#sorryformybadenglish
Re: Really need anti fake kill. -
JaydenJason - 22.03.2015
https://sampforum.blast.hk/showthread.php?tid=322342
Atleast make an attempt to either search or make your own antifakekill script
Re: Really need anti fake kill. -
Gammix - 22.03.2015
pawn Код:
new deathdata[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
deathdata[playerid] = INVALID_PLAYER_ID;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
deathdata[playerid] = INVALID_PLAYER_ID;
return 1;
}
public OnPlayerSpawn(playerid)
{
deathdata[playerid] = INVALID_PLAYER_ID;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(deathdata[playerid] == INVALID_PLAYER_ID)
{
deathdata[playerid] = killerid;
deathdata[killerid] = playerid;
}
return 1;
}
stock DeathMessage(playerid, killerid, reason)
{
if(deathdata[playerid] == killerid && deathdata[killerid] == playerid)
{
deathdata[playerid] = INVALID_PLAYER_ID;
deathdata[killerid] = INVALID_PLAYER_ID;
return SendDeathMessage(playerid, killerid, reason);
}
else return false;
}
Make sure you hook
DeathMessage func with
SendDeathMessage. So as to completely run the death list with vars.
Hook the callbacks as well and use as an include.
NOTE:
- You can only send a death message if the player has killed the other player
- Function will return false if the player wasnt killed by the specified killer
- Death data of player will reset on spawn i.e. you must send death message before spawn
** Though i am not sure if this will work but anything is better than nothing AND this to prevent fake death messages.
Re: Really need anti fake kill. -
MBilal - 22.03.2015
Put this under OnPlayerDeath and check
Код:
//anti-fake kill
if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1) Ban(playerid);
SetPVarInt(playerid,"PlayerLastDeath",gettime());