GetPlayerHealth 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: GetPlayerHealth bug? (
/showthread.php?tid=534386)
GetPlayerHealth bug? -
kamiliuxliuxliux - 29.08.2014
When you die and you're between death and spawn (player's laying on the ground dead and camera is swinging above player), I used GetPlayerHealth and function supposed to return 0. But no. It returned my last health points before death. Let's say I have 100 HP and use /kill which set health to 0. When I use that function between death and spawn, it returns me 100 HP. Is that bug or smth? And is there any ways to fix that?
Re: GetPlayerHealth bug? -
Abagail - 29.08.2014
Do you have a customized death system, or did you test this on Grand Larceny, or something?
Re: GetPlayerHealth bug? -
kamiliuxliuxliux - 29.08.2014
Yeah, I've just tested it on empty GM, it bugs.
AW: GetPlayerHealth bug? -
CutX - 29.08.2014
i just tested this with OnPlayerUpdate.
set my health to 1.0 and jumped off some building.
it always returned my "last health" which was 1.0.
so no, it's not set to 100. it's set to 100 once you respawn.
& there's no bug.
Re: GetPlayerHealth bug? -
kamiliuxliuxliux - 29.08.2014
I said that it returns "last health" which in my case was 100, (and 1 in yours)
Re: GetPlayerHealth bug? -
Abagail - 29.08.2014
I haven't myself tested it, how-ever I believe a solution could be detecting the death animation an some other small checks, and then if the checks are positive return the proper value of 0 on GetPlayerHealth. Not sure, if it's worth it, though, since it takes 5-10 seconds before the player respawns after dying.
AW: Re: GetPlayerHealth bug? -
CutX - 29.08.2014
Quote:
Originally Posted by kamiliuxliuxliux
I said that it returns "last health" which in my case was 100, (and 1 in yours)
|
so?
it's not a bug, it's supposed to be like this.
you could create your own "health-system"
for server-sided health
Re: GetPlayerHealth bug? -
Clad - 29.08.2014
Why would you use GetPlayerHealth when you are dead ? It's too clear that you have 0 Heal Points
Re: GetPlayerHealth bug? -
kamiliuxliuxliux - 29.08.2014
It's anti-cheat bro, anti-cheat...
Re: GetPlayerHealth bug? -
Clad - 29.08.2014
Quote:
Originally Posted by kamiliuxliuxliux
It's anti-cheat bro, anti-cheat...![Cheesy](images/smilies/biggrin.png)
|
You mean anti cheat against HH ? Or what kind ?