Help, sort maps by number of votes, I want the map with the most votes to be this first.
CODE
PHP Code:
set_hudmessage(0,255,0,0.23,0.02,0,0.0,fTime,0.0,0.0,1);
show_hudmessage(0,"%L",LANG_PLAYER,"PUG_HUD_MAP");
new szMaps[256],iVotes;
for(new x;x < PUG_iMapCount;++x)
{
if(PUG_iMapVotes[x])
{
iVotes++;
format
(
szMaps,
charsmax(szMaps),
"%s%s - %d %s^n",
szMaps,
PUG_szMapNames[x],
PUG_iMapVotes[x],
(PUG_iMapVotes[x] > 1) ? "votos" : "voto"
);
}
}
new szNone[32];
formatex(szNone,charsmax(szNone),"%L",LANG_PLAYER,"PUG_HUD_NONE");
set_hudmessage(255,255,255,0.23,0.05,0,0.0,fTime,0.0,0.0,2);
show_hudmessage(0,iVotes ? szMaps : szNone);