SA-MP Forums Archive
Health Textdraw 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)
+--- Thread: Health Textdraw problem (/showthread.php?tid=480687)



Health Textdraw problem - Iron3man - 12.12.2013

hi i want to make a health textdraw.
In making that i have no problem

But the health textdraw show the health of a player in decimal(like 100.000000)
I want that it should be come without decimal(like 100)
I have use these codes

Код:
new String[1000], Float:hp;
GetPlayerHealth(playerid,hp);
format(String, sizeof(String), "%f", hp);
TextDrawSetString(HA1[0][playerid], String);
Please help me!!
Thanks..


Re: Health Textdraw problem - Tagathron - 12.12.2013

You can use floatround.
for example:
pawn Код:
floatround(hp, floatround_round);
Then when you set the textdraw the health will be displayed as integer.
Check more at :https://sampwiki.blast.hk/wiki/Floatround


Re: Health Textdraw problem - Wesley221 - 12.12.2013

pawn Код:
format(String, sizeof(String), "%.0f", hp);
If im right this will do it aswell


Re: Health Textdraw problem - Iron3man - 12.12.2013

Thank u both of u!!
I got the solution