SA-MP Forums Archive
Help health textdraw - 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: Help health textdraw (/showthread.php?tid=602586)



Help health textdraw - 123eee123 - 09.03.2016

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...


Re: Help health textdraw - nerovani - 09.03.2016

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


Re: Help health textdraw - UltraScripter - 09.03.2016

Show your code


Re: Help health textdraw - 123eee123 - 09.03.2016

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



Re: Help health textdraw - MicroKyrr - 10.03.2016

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); 



Re: Help health textdraw - 123eee123 - 10.03.2016

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...


Re: Help health textdraw - itsCody - 10.03.2016

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.


Re: Help health textdraw - 123eee123 - 10.03.2016

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


Re: Help health textdraw - UltraScripter - 10.03.2016

1) use %0.f
2) use playertext