Exact player health (Text Draw)
#1

Hello there
I want to do something to get the EXACT player's health
I did something like this:
PHP код:
                      new Float:Health;
                      
GetPlayerHealth(playeridHealth);
                      new 
pingss[128];
                      
format(pingsssizeof(pingss), "%.2f"Health);
                      
PlayerTextDrawSetString(playeridHP_TD[playerid], pingss); 
but it was only show player health e.g. (100.00 or 85.00 or 44.00) but I want a script to show EXACT player health e.g. 85.56 or 65.10 or 44.98 .. and like these..
If you know what should I do tell me...
Reply
#2

You created a float variable. If health is actually a decimal number you will see a decimal number, either you will see an integer.
In my personal experience I never got a player's health resulting in a decimal number, though GetPlayerHealth requires a float variable to work correctly.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Health isn't actually stored as a float internally (so don't ask me why it is returned as one), so there isn't an "exact" health.
Probably because of custom health scripts
Reply
#4

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Probably because of custom health scripts
He's talking about the native itself.
Reply
#5

TY All
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)