27.11.2015, 22:12
Hey I was wondering how to display something in percents so this is what I did:
Everything is working fine but.. it doesn't actually calculate how much percent is "Enota" of 270...(Celota) so it says "which is exactly 0 percent" .. can you help me out from this cuz I somehow feel I'm so close with that code..
pawn Код:
new Celota = 270;
new Enota = 270;
pawn Код:
SetTimerEx("EnotaDol", 1000, true, "i", playerid);
pawn Код:
public EnotaDol()
{
Enota --;
return 1;
}
pawn Код:
stock Procenti(playerid)
{
new string[128];
new Procent;
Procent = floatround((Enota / Celota)*100, floatround_round);
format(string, sizeof(string),"There is currently %d Enot, which is exactly %.0f% percent!",Enota,float(Procent));
SendClientMessage(playerid,-1,string);
}
pawn Код:
CMD:procenti(playerid, params[])
{
Procenti(playerid);
return 1;
}