I want to see the percent of all players on the server but it doesnt work
exemple this line shows me how many percent i got
and it works great
Code:
Terroist Surviver </td><td> %i / %i </td><td> %d%% </td></tr>", iAchLevel[i][SURVIVE], iAchPoints[SURVIVE], 100 * iAchLevel[i][SURVIVE] / iAchPoints[SURVIVE]);
But this line dont shows me players percent
when i open the meny it shows that i got 0% and evry body else got random percent LOL
Code:
new szMenuKey[128];
for( new i; i < iNum; i++ )
{
iPlayer = iPlayers[i];
new percent = 100 * iAchLevel[i][i]/iAchPoints[i]
get_user_name(iPlayer, szName, charsmax(szName));
format(szMenuKey,127,"%s%s \d[%d%%]^n",(id==iPlayer)?"\r":"",szName,percent);
num_to_str(iPlayer, szKey, charsmax(szKey));
menu_additem(iMenu, szMenuKey, szKey);
but if i change the code to
Code:
new szMenuKey[128];
for( new i; i < iNum; i++ )
{
iPlayer = iPlayers[i];
new percent = 100 * iAchLevel[id][i]/iAchPoints[i]
get_user_name(iPlayer, szName, charsmax(szName));
format(szMenuKey,127,"%s%s \d[%d%%]^n",(id==iPlayer)?"\r":"",szName,percent);
num_to_str(iPlayer, szKey, charsmax(szKey));
menu_additem(iMenu, szMenuKey, szKey);
the percent only works for guys that open the meny
and here is the array
Code:
new iAchLevel[MaxPlayers][iAchCount]
and here is a other iAchLevel line in the plugin
Code:
iAchLevel[id][JUMP]++
How can i fix so it shows evryones stats including my own in the menu?
__________________