Quote:
Originally Posted by HamletEagle
How do you handle votes and strings?
|
Well, on the menu, when u press a key, it increases the keycount[key] value, and that value corresponds to s_Maps[key]. What I want is to display the maps depending on the vote value correctly, so the corect s_Maps and keycount should be displayed in the hud.
Here is what I did so far
Code:
public VotesHud()
{
new szMaps[1024], szList[1024], iLen;
for(new x;x < MAX_MAPS+1;++x)
{
iLen += formatex(szMaps[iLen], charsmax(szMaps),"%s. %s - %i %s^n",map_position[x], s_Maps[x], keycount[x],(keycount[x] > 1) ? "votes" : "vote");
}
formatex(szList, charsmax(szList), "Vote Results:^n%s", szMaps);
set_hudmessage(0, 255, 0, 0.65 ,0.05, 0, 0.5, 0.5, 0.0, 0.0, -1);
ShowSyncHudMsg(0, gResultsVotes, szList);
}