SA-MP Forums Archive
GetPlayerHealth Problem lol - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerHealth Problem lol (/showthread.php?tid=130225)



GetPlayerHealth Problem lol - BlackFoX - 25.02.2010

I think GetPlayerHealth have a Bug, when i save it in any Variable,
but i set it before it Returns 2-3 Times the Same Value so i set the Health to 900.0
it return again 1000.0 , 3x Times and it return the right Value

how said i think it is an Sa-mp Bug but i'm not rly Sure


Re: GetPlayerHealth Problem lol - Double-O-Seven - 25.02.2010

GetPlayerHealth only gives values between 0.0 and 255.0
If you set for example a players health to 1024 (256*4) it will give 0.0, if you set it to 1023 ((256*4)-1), it will return 255.0

(256.0*x)-1.0 will always give 255.0 when x is a whole number...


Re: GetPlayerHealth Problem lol - BlackFoX - 25.02.2010

But Maximal Player Health is 1000.0


Re: GetPlayerHealth Problem lol - Double-O-Seven - 25.02.2010

I thought clientside it was higher... if I use /god on my server and it takes ages to kill me with minigun when my health was set to 99999.


Re: GetPlayerHealth Problem lol - Correlli - 25.02.2010

Quote:
Originally Posted by BlackFoX_UD_
But Maximal Player Health is 1000.0
That's for vehicle.

http://forum.sa-mp.com/index.php?top...4476#msg924476


Re: GetPlayerHealth Problem lol - BlackFoX - 25.02.2010

But when i set 1000.0 for Player Health it was exactly 100% of Health Bar , the same result 100.0 = 10%
But ok now know why GetPlayerHealth wont return the right Value

Thank you Guys