30.04.2013, 21:20
Hello everybody I am planning to make a vote map system but I got one problem about loop.How to use loop to get number of players who voted for one map.Anyone got idea?
new votes[NUMBER_OF_MAPS_HERE];
votes[MAP_NUMBER_HERE]++;
new numvotes, winner;
for(i=0;i<NUMBER_OF_MAPS_HERE;i++)
{
if(votes[i] > numvotes)
{
winner = i;
}
}
Sure, just add an array at the top of your script, like this:
pawn Code:
pawn Code:
pawn Code:
|