Health Textdraw problem
#1

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..
Reply
#2

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
Reply
#3

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

Thank u both of u!!
I got the solution
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)