SA-MP Forums Archive
help value - 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 value (/showthread.php?tid=128603)



help value - FireFox_ - 18.02.2010

I have this command

pawn Код:
if(strcmp(cmdtext, "/stats", true) == 0)
    {
new Float:health, Float:armour;
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
format(s, sizeof(s),"Health: %f | Armour: %f\nScore: %d | Money: %d", health, armour, GetPlayerScore(playerid), GetPlayerMoney(playerid));
    ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX,"Your Stats",s,"Done","Cancel");
        return 1;
    }
Everything works great but the health value is 100.00000 how can i make it to be only 100?


Re: help value - FireFox_ - 19.02.2010

Bump


Re: help value - pyrodave - 19.02.2010

Instead of %f use %0.0f if you want 2 decimal places use %0.2f if you want 1 decimal place %0.1f etc etc.