Creating vote system
#1

I am going to create a system like /votemap
Now i have on top for example:
pawn Код:
new MapVotes[5];
under ondialogresponse thingy
pawn Код:
MapVotes[0] ++;
else
MapVotes[1] ++;
now how i make a little code that tracks what map has the most votes?
Reply
#2

Hi again FuTure`,

You think you could show us a bit more of the code so we can get an idea of exactlly what you are doing?

Cheers,

TJ
Reply
#3

If you already have the vote counts than you just need to compare

pawn Код:
new map;
for(new i; i < sizeof MapVotes; i++)
    if(MapVotes[map] < MapVotes[i])
        map = i;
This is a stable algorithm so if the first and the third map got five votes the first will be choosen
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)