OnPlayerTakeDamage/OnPlayerGiveDamage - 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: OnPlayerTakeDamage/OnPlayerGiveDamage (
/showthread.php?tid=513521)
OnPlayerTakeDamage/OnPlayerGiveDamage -
audriuxxx - 16.05.2014
Hi,
I'am using this both callback's.
I want to ask:
Which callback will be called first, when somebody shoot to somebody?
If i set player health, and then in other callback getplayerhealth, i get that health which i set or that health, what player have
Re: OnPlayerTakeDamage/OnPlayerGiveDamage -
ball - 16.05.2014
First will be called OnPlayerGiveDamage
Re: OnPlayerTakeDamage/OnPlayerGiveDamage -
audriuxxx - 16.05.2014
You test it?
Re: OnPlayerTakeDamage/OnPlayerGiveDamage -
Pottus - 16.05.2014
Depends, sometimes OnPlayerGiveDamage() won't be called at all but it will always call first if it is called. I'll be honest with you however, OnPlayerTakeDamage() is completely useless when it comes to bullet damage a proper damage system should only use OnPlayerGiveDamage() the new lag comp is unreliable so you should have a skin hit system which uses OnPlayerGiveDamage() and issues the damage. Of course you will still need OnPlayerTakeDamage() to detect fall damage etc.