Make the player not die even though he would've died. - 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: Make the player not die even though he would've died. (
/showthread.php?tid=382048)
Make the player not die even though he would've died. -
oliverrud - 01.10.2012
Is there some way, possibly through OnPlayerTakeDamage or something like that, that if the player was supposed to die, his health reaching 0, that you can before he actually dies ingame recover his health to let's just say 100.
As far as I understand OnPlayerTakeDamage is a callback after the player has taken damage, is there someway to detect it before it actually happens somehow and that way prevent the kill?
Re: Make the player not die even though he would've died. -
oliverrud - 01.10.2012
OnPlayerUpdate doesn't work.
Re: Make the player not die even though he would've died. -
Face9000 - 01.10.2012
Quote:
Originally Posted by SaYrOn
You can add a check under OnPlayerUpdate. It is called each 30ms, if I remember right, so you will catch if player's health is below 1, for example.
|
https://www.youtube.com/watch?v=umDr0mPuyQc
Don't use OnPlayerUpdate because it calls EVERY action of what the player make.
Use a custom timer,like HealthCheck (remember public and forward).