SA-MP Forums Archive
Why?SetPlayerHealth and Armour problem - 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: Why?SetPlayerHealth and Armour problem (/showthread.php?tid=111341)



Why?SetPlayerHealth and Armour problem - kymsar - 01.12.2009

SetPlayerHealth(playerid,5000)
and
new Float:health;
GetPlayerHealth(playerid,health);
new string[128];
format(string,sizeof(string),"health:%.0f",health) ;
SendCliendMessage(playerid,COLOR_RED,string);

it showed 136 not 5000……
that is a big problem with my 3dlabel display

any idea?


Re: Why?SetPlayerHealth and Armour problem - Remi-X - 01.12.2009

You can't have a health from 5000, lol :P
A full healthbar uses 100.0, not more. 136 will be the maximum, but with 100 your healthbar will be full.
And you're using an integer at SetPlayerHealth, maybe it's better to use a float.
SetPlayerHealth(playerid, 100.0);


Re: Why?SetPlayerHealth and Armour problem - Correlli - 01.12.2009

Quote:
Originally Posted by Remi-X
And you're using an integer at SetPlayerHealth, maybe it's better to use a float.
Not in 0.3 version.