Map Votes loop (More than 2 maps)
#1

Hello there

I made a derby script this is the loop which checks which map has the most votes:

Код:
	new highestvar = -1;

	for(new i = 0; i < sizeof(DerbyMapVotes); i++)
	{
 		if(DerbyMapVotes[i] > highestvar)
		{
  			highestvar = DerbyMapVotes[i];
		}
	}
But it dont works when:

there are 4 maps: Map1Votes: 3
Map2Votes: 3
Map3Votes: 0
Map4Votes: 0
It will always choose Map1... How to extend this loop that it works how it should?

Thank you very much!!
Reply


Messages In This Thread
Map Votes loop (More than 2 maps) - by Mellnik - 11.08.2012, 19:14
Re: Map Votes loop (More than 2 maps) - by Roko_foko - 11.08.2012, 19:20
Re: Map Votes loop (More than 2 maps) - by leonardo1434 - 11.08.2012, 19:26
Re: Map Votes loop (More than 2 maps) - by Roko_foko - 11.08.2012, 19:42
Re: Map Votes loop (More than 2 maps) - by leonardo1434 - 11.08.2012, 19:48
AW: Re: Map Votes loop (More than 2 maps) - by Mellnik - 11.08.2012, 21:22

Forum Jump:


Users browsing this thread: 1 Guest(s)