Just practice
#1

Hey I was wondering how to display something in percents so this is what I did:

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;
}
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..
Reply


Messages In This Thread
Just practice - by Razturach - 27.11.2015, 22:12
Re: Just practice - by TwinkiDaBoss - 28.11.2015, 01:20
Re: Just practice - by Razturach - 28.11.2015, 20:04
Re: Just practice - by TwinkiDaBoss - 28.11.2015, 20:10
Re: Just practice - by Ahmad45123 - 28.11.2015, 20:19
Re: Just practice - by AbyssMorgan - 28.11.2015, 20:20
Re: Just practice - by Razturach - 01.12.2015, 11:14

Forum Jump:


Users browsing this thread: 1 Guest(s)