SA-MP Forums Archive
onplayerdeath problem - 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: onplayerdeath problem (/showthread.php?tid=645051)



onplayerdeath problem - RedGun2015 - 18.11.2017

Hello guys, I use this include for detecting players that use AirBrake
https://sampforum.blast.hk/showthread.php?tid=474196

The problem is, when a player is killed by another player, OnPlayerDeath is called twice
And if a player kill with Deagle another Player, in server logs appears something like this:
Код:
[02:04:10] [debug] OnPlayerDeath(0, 1, 0)
[02:04:10] DEATH: tiwerOfficial was killed by NEGATiWE with gun 0
[02:04:10] [debug] OnPlayerDeath(0, 65535, 255)
So, he killed my with deagle (reason 24) but above is 0, because of the include.
How can i solve?


Re: onplayerdeath problem - RedGun2015 - 21.11.2017

bump


Re: onplayerdeath problem - Lucases - 21.11.2017

INVALID_PLAYER_ID = killerid = 65535

Means there's no killer


Re: onplayerdeath problem - RedGun2015 - 22.11.2017

I know that man, but OnPlayerDeath is called twice, that is my problem. How can I fix?


Re: onplayerdeath problem - RedGun2015 - 26.11.2017

bump


Re: onplayerdeath problem - rfr - 26.11.2017

Can we see the OnPlayerDeath code?


Re: onplayerdeath problem - RedGun2015 - 27.11.2017

Quote:
Originally Posted by rfr
Посмотреть сообщение
Can we see the OnPlayerDeath code?
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    s_AirbreakDetectImmunity[playerid] = gettime() + 3;

	#if defined AB_OnPlayerDeath
	    return AB_OnPlayerDeath(playerid, killerid, reason);
	#else
	    return 1;
	#endif
}