find the biggest variable by looping
#6

pawn Код:
new biggest;
for(new i = 0; i < sizeof(VoteOptions); i++)
    if(VoteOptions[i] > biggest)
        biggest = VoteOptions[i];

if(biggest == VoteOptions[0])
{
    //Do smth. when variable 1 is the biggest
}
else if(biggest == VoteOptions[1]
{
           //Do smth. when variable 2 is the biggest
}
else if(biggest == VoteOptions[2])
{
    //Do smth. when variable 3 is the biggest
}
            //etc...
Should work too.
Reply


Messages In This Thread
find the biggest variable by looping - by CounterTerroristUnit - 12.11.2011, 20:20
Re: find the biggest variable by looping - by Sascha - 12.11.2011, 20:25
Re: find the biggest variable by looping - by CounterTerroristUnit - 12.11.2011, 20:39
Re: find the biggest variable by looping - by Sascha - 12.11.2011, 20:40
Re: find the biggest variable by looping - by CounterTerroristUnit - 12.11.2011, 20:47
Re: find the biggest variable by looping - by MadeMan - 12.11.2011, 20:48
Re: find the biggest variable by looping - by Sascha - 12.11.2011, 20:54
Re: find the biggest variable by looping - by CounterTerroristUnit - 12.11.2011, 21:08

Forum Jump:


Users browsing this thread: 1 Guest(s)