Help health textdraw
#1

My health textdraw get bug.
Health > 0 and Health < 200 => Correct number.
Health > 200 => Incorrect number.
Ex: /sethp me 300 => Textdraw Number: 44
Why? Help me...
I used %.0f for my string...
Reply
#2

If you formated the string with %s, change it to %d.
Reply
#3

Show your code
Reply
#4

Код:
new string[1000];
new Float:pHealth;
GetPlayerHealth(playerid,pHealth);
format(string, sizeof(string), "%.0f", pHealth);
TextDrawSetString(Health[playerid], string);
Reply
#5

That string is too big , I never reached that age yet and make sure you have already a textdraw.

PHP код:
new string[10];
new 
Float:pHealth;
GetPlayerHealth(playerid,pHealth);
format(stringsizeof(string), "%d.0f"pHealth);
TextDrawSetString(Healthstring);
TextDrawShowForPlayer(playeridHealth); 
Reply
#6

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
That string is too big , I never reached that age yet and make sure you have already a textdraw.

PHP код:
new string[10];
new 
Float:pHealth;
GetPlayerHealth(playerid,pHealth);
format(stringsizeof(string), "%d.0f"pHealth);
TextDrawSetString(Healthstring);
TextDrawShowForPlayer(playeridHealth); 
Can't...
Reply
#7

Doing textdraws like this one, they should be per-player.

Post where you're creating the text draws, where you're updating the values, everything that this textdraw relates to.
Reply
#8

Allow health: 0 - 255.
if health 256 => Show 0 on textdraw
Reply
#9

1) use %0.f
2) use playertext
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)