25.03.2013, 19:39
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
Ok, so 638 is the maximum width, units[playerid] is the width of the bar(this changes when the player makes more kills)
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]);