Looping
#4

Just add an array at the top of your script, like this:

pawn Code:
new votes[NUMBER_OF_MAPS_HERE];
then under where someone votes:

pawn Code:
votes[MAP_NUMBER_HERE]++;
and then do something like this to find the highest voted map:

pawn Code:
new numvotes, winner;
for(i=0;i<NUMBER_OF_MAPS_HERE;i++)
{
    if(votes[i] > numvotes)
    {
        winner = i;
    }
}
and then the winner is votes[winner]
Reply


Messages In This Thread
Looping - by Sanady - 30.04.2013, 21:20
Re: Looping - by MattyG - 30.04.2013, 21:23
Re: Looping - by Sanady - 30.04.2013, 21:24
Re: Looping - by MattyG - 30.04.2013, 21:31
Re: Looping - by Sanady - 30.04.2013, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)