How to make anti fake kill?
#1

I saw this:

Quote:
Originally Posted by Pottus
Посмотреть сообщение
I'm not sure if fake killing works anymore but I never use the OnPlayerDeath() call back, I use OnPlayerTakeDamage() and OnPlayerStateChange() to detect death then directly call the death callback... the best solution is.

OnPlayerDeath(playerid, killerid, reason) { return 1; }
How to make that script like Pottus said?

Sorry for my badenglish.
Reply
#2

Quote:
Originally Posted by cessil
Посмотреть сообщение
You could also use OnPlayerGiveDamage and OnPlayerTakeDamage and store if they hit the other player.
If you implement GetPlayerTargetPlayer then remember that not everything will call that like if they're using a joypad, if they're in a vehicle and also guns have target ranges which are shorter than the damage ranges which means you can kill someone with an m4 without GetPlayerTargetPlayer returning their id if they're far away enough
this one below should work
Quote:

You could always check if the "killer" is actually carrying the weapon they supposedly killed with.

Код:
//OnPlayerDeath
if(GetPlayerWeapon(killerid) != reason) //if the weapon "killerid" has is not the weapon used to kill "playerid"
{
	//"playerid" used a fake kill
}
You could check for distances of kills if they're bigger than 330, check distance between players with melee kills and if its bigger than lets say 10, its a fake kill
Reply
#3

Try This

Код:
public OnPlayerDeath(playerid,killerid,reason)
{
	if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1) Kick(playerid);
	SetPVarInt(playerid,"PlayerLastDeath",gettime());
	return 1;
}
Reply
#4

i want like Pottus said
Reply
#5

bump
Reply
#6

This part:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_SPAWNED && newstate == PLAYER_STATE_WASTED)
    {
        // Call a function or do what you have to do here (Replacement for OnPlayerDeath(playerid)).
    }
    return 1;
}
I will look further into this, later on.
Reply
#7

OnPlayerDeath works fine in most cases. Just check that killerid is actually holding the weapon that was reported as the death reason and that both players are in range of each other (sniper has the longest range, 100 meters I believe). Most fake-killers also spam the cheat, so what Devon said above could also help, although I would advise against the use of slow PVars in favor of a static local.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)