SA-MP Forums Archive
OnPlayerGiveDamage help. - 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: OnPlayerGiveDamage help. (/showthread.php?tid=417723)



OnPlayerGiveDamage help. - PaulDinam - 22.02.2013

I made this:

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
	if(PlayerIsWounded(damagedid))
	{
		SetPlayerHealth(damagedid, 20);
	}
    return 1;
}
When player attacks the player normally it works and with gun no.. it just kills the player


Re: OnPlayerGiveDamage help. - MP2 - 22.02.2013

This callback is called BEFORE the player takes damage on thei client, so they only have 20 health when they get shot, which is low enough to get them killed. Use OnPlayerTakeDamage.


Re: OnPlayerGiveDamage help. - PaulDinam - 22.02.2013

Nevermind it works, I just had to set player hp to more than 60