/stats
#1

Hi,

in my /stats command i am using information about showing an health points to the player, i have it like this:


Код:
new Float:pHP;
GetPlayerHealth(playerid,pHP);
format(string,sizeof string,"HP Amount: %d",pHP);
strcat(str, string);
ShowPlayerDialog... and stuff
and when i type /stats it is showing me really over 10 milion hp, which is not correct.

Off course, i have just 100hp, so why it is not showing the correct number? Thanks.
Reply
#2

%d to %f

( pHP = float = %f )
Reply
#3

Can you please give your full /stats command?

Glad2BeHere is right, health need to be float (f%) not int (%d).
Reply
#4

pHP = Float variable.

try: %f.
Reply
#5

Thank you both Glad2BeHere and Sweet, it helped a lot. REP+

iMFear: %i is the same thing as %d.
Reply
#6

Quote:
Originally Posted by _GHT_MarK445
Посмотреть сообщение
iMFear: %i is the same thing as %d.
Right for output, wrong for input.
Reply
#7

I am using just output, so that is why i told that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)