PDA

View Full Version : Anti Fake killing suggestions.


VenomMancer
22/03/2015, 07:56 AM
Hello i have made this script for stop Fake killers in my server.
this will works or ?

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
SPVI(playerid,"Attacker",issuerid);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(GPVI(playerid,"Attacker")!= killerid) return Kick(killerid);
return 1;
}

Give me suggestion if you have.
#sorryformybadenglish

alexus
22/03/2015, 01:22 PM
Fake kill is not used by the killer, the faker is who dead... so kick the victim, not the killer !

VenomMancer
22/03/2015, 04:26 PM
ops sorry .
btw thanks :D

mirou123
22/03/2015, 04:38 PM
It should work but due to the crappy sync in SAMP it might give false positives. A better way to do it is to save the time at which the person died and check it each time he dies. If he is dieing too quick like twice in a second then he i hacking. It can be bypassed though if they do it slow. It helps a bit though. But go ahead and try your code and let us know if it worked.

VenomMancer
23/03/2015, 08:39 AM
Tested, and works!

mirou123
23/03/2015, 10:19 AM
Tested, and works!

Make sure you try it many times. Like if you die by falling, drawning, car explosion when you are inside the vehicle and when you are near it, try it whith /sethp 0 or /kill if you have those etc..

VenomMancer
28/03/2015, 12:47 PM
all works fine.
but still fake killer have at my server -_-

Help me on this thread:
http://forum.sa-mp.com/showthread.php?p=3416060&posted

Pottus
28/03/2015, 12:51 PM
This is not the correct approach at all.

1.) Save time of last death of a player.
2.) On next death check time ex. GetTickCount() - LastDeathTime[playerid]
3.) Is it less than your tolerance? Example 1000ms ?
4.) If so kick player

VenomMancer
28/03/2015, 01:00 PM
This ?

public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
//------------------------------------------------------------------------------
// Anti fake kill
//------------------------------------------------------------------------------
if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1) return Kick(playerid);

SetPVarInt(playerid,"PlayerLastDeath",gettime());
return 1;
}

Jefff
28/03/2015, 05:26 PM
time is only for fake kill flood, you can also check http://wiki.sa-mp.com/wiki/IsPlayerStreamedIn

VenomMancer
29/03/2015, 12:53 AM
This ?

Under onplayertakedamage :

if(!IsPlayerStreamedIn(playerid, killerid))
{
if(GetPlayerWeapon(killerid) != reason) return Kick(playerid);
}

Jefff
29/03/2015, 01:22 AM
in OnPlayerDeath + you can try in OnPlayerGive/TakeDamage

DamageTime[playerid] = gettime() + 2;

then in OnPlayerDeath

if(0 <= killerid < MAX_PLAYERS)
{
if(DamageTime[playerid] < gettime() || !IsPlayerStreamedIn(playerid, killerid))
{
// possibly fake kill
return 0;
}
}

VenomMancer
29/03/2015, 01:49 AM
full of this script ? :p

CalvinC
29/03/2015, 08:56 AM
Place it in the OnPlayerDeath callback.

VenomMancer
29/03/2015, 09:09 AM
Can make for me ? :D

CalvinC
29/03/2015, 09:17 AM
Here you can see the public:
http://wiki.sa-mp.com/wiki/OnPlayerDeath
There's even an example, just place it under that instead of the SendDeathMessage etc.