SA-MP Forums Archive
SetPlayerHealth bug? - 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: SetPlayerHealth bug? (/showthread.php?tid=576133)



SetPlayerHealth bug? - Aerotactics - 01.06.2015

I've noticed in the places I have SetPlayerHealth to 0, the player doesn't die immediately, and can walk around for several seconds afterwards. Is this a bug? Or lag? I was testing on local, though.


Re: SetPlayerHealth bug? - SoFahim - 01.06.2015

Hmm. Try to set his hp -1 If he don't die, Then your script problem


Re: SetPlayerHealth bug? - Aerotactics - 01.06.2015

Quote:
Originally Posted by SoFahim
Посмотреть сообщение
Hmm. Try to set his hp -1 If he don't die, Then your script problem
Same problem. I'll check my script.


Re: SetPlayerHealth bug? - Bennyy - 01.06.2015

When you get a chance go ahead and paste the code here for the onplayerdeath, I think I might know the issue however would have to see whats going on for myself


AW: SetPlayerHealth bug? - Kaliber - 01.06.2015

Quote:
Originally Posted by Aerotactics
Посмотреть сообщение
Is this a bug?
Yes it's a bug.

Write it like this:

PHP код:
//At top of your script
#if !defined FLOAT_INFINITY
    #define FLOAT_INFINITY (Float:0x7F800000)
#endif
//Then do this in the command:
SetPlayerHealth(playerid,-FLOAT_INFINITY); 
Greekz


Re: SetPlayerHealth bug? - Aerotactics - 01.06.2015

Quote:
Originally Posted by Bennyy
Посмотреть сообщение
When you get a chance go ahead and paste the code here for the onplayerdeath, I think I might know the issue however would have to see whats going on for myself
Well, beforehand, I had one line of code in onplayerdeath, no i have removed that code, and I haven't had any problems. The issue I think was that SetPlayerHealth was being called twice in certain instances, so the second time it was called, it gave the player time to move around.