HELP | IN FLOAT NUMBERS - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP | IN FLOAT NUMBERS (
/showthread.php?tid=274971)
HELP | IN FLOAT NUMBERS -
EviLpRo - 07.08.2011
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
Re: HELP | IN FLOAT NUMBERS -
RyDeR` - 07.08.2011
Use "%.01f" istead of "%f".
Re: HELP | IN FLOAT NUMBERS -
EviLpRo - 07.08.2011
thank's
this work