Print %f remains 0
#1

Hi,

I'm trying to make a simple ranking script. My ranks are working already but I also want to have a exp bar. i managed to create an expbar that changes size with the amount of kills left. however i want to display the percentage, somehow it remains 0 after the calculation

Код:
        killsleft[playerid] = tillnext[playerid] - GetPlayerScore(playerid);
	units[playerid] = (638/ tillnext[playerid]) * killsleft[playerid];
	displaypercentage[playerid] = (units[playerid]/638)*100;//this line goes wrong
	
	new string[24+3+1];
	format(string,sizeof(string),"Exp: %f%%", displaypercentage[playerid]);
Ok, so 638 is the maximum width, units[playerid] is the width of the bar(this changes when the player makes more kills)
Reply


Messages In This Thread
Print %f remains 0 - by klotebandit - 25.03.2013, 19:39
Re: Print %f remains 0 - by Dubya - 25.03.2013, 19:41
Re: Print %f remains 0 - by klotebandit - 25.03.2013, 19:45
Re: Print %f remains 0 - by Patrick - 25.03.2013, 19:49
Re: Print %f remains 0 - by klotebandit - 25.03.2013, 19:51
Re: Print %f remains 0 - by Vince - 25.03.2013, 20:15
Re: Print %f remains 0 - by klotebandit - 25.03.2013, 20:20

Forum Jump:


Users browsing this thread: 2 Guest(s)