HELP | IN FLOAT NUMBERS
#1

hello!

have me small question in float numbers....

i try to make command , write the health from the player..

this the command:

pawn Код:
if(!strcmp(cmdtext,"/MyHealth",true))
{
    new Health;
    GetPlayerHealth(playerid,Health);
    format(String,256,"Your health is: %f.",Health);
    SendClientMessage(playerid,c_red,String);
    return true;
}
but this write this:

if have me 100% health.
this write:
100.00000000

instead 100.0

what's thie happen ?

thank for the helpers
Reply
#2

Use "%.01f" istead of "%f".
Reply
#3

thank's
this work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)