Map Votes loop (More than 2 maps)
#6

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
I think this will help. If not, reply.
pawn Код:
new highestvar = DerbyMapVotes[0],Hvar=0;

    for(new i = 1; i < sizeof(DerbyMapVotes); i++)
    {
        if(DerbyMapVotes[i] > highestvar)
        {
            highestvar = DerbyMapVotes[i];
            Hvar=0;
        }
        else if(DerbyMapVotes[i] == highestvar)Hvar++;
    }
//if Hvar is 1 or more, that means there is tie/draw in voting
Thanks I improved it a bit:
Код:
	new highestmapvotes = -1;
	new draw = 0;
	for(new i = 0; i < sizeof(DerbyMapVotes); i++)
	{
 		if(DerbyMapVotes[i] > highestmapvotes && draw == 0)
		{
  			highestmapvotes = DerbyMapVotes[i];
		}
		else if(DerbyMapVotes[i] > highestmapvotes && draw != 0)
		{
		    draw = 0;
		}
		else if(DerbyMapVotes[i] == highestmapvotes)
		{
		    draw++;
		}
	}
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)