10.02.2013, 23:08
How do I make my health show just 100 instead of 100.000000 when I type /stats? I'm using a float for the health (and %f for format string)
new str1[24],Float:health;
GetPlayerHealth(playerid,health);
fomat(str1,sizeof(str1),"Health: %i",floatround(health,floatround_round));
%.0f
public OnPlayerUpdate(playerid)
{
new Float:health, query[500], pname[24];
GetPlayerName(playerid, pname, 24);
GetPlayerHealth(playerid, health);
PlayerInfo[playerid][pHealth] = health;
format(query, sizeof(query), "UPDATE playerdata SET Health=%f WHERE Username='%s'",
PlayerInfo[playerid][pHealth],
pname);
mysql_query(query);
return 1;
}