find the biggest variable by looping
#2

pawn Код:
new highest[2] = {VoteOptions[0], 0};
for(new n=0; n<40; n++) //change the 40 to your highest number + 1 (highest number = amount)
{
    if(VoteOptions[n] > highest[0])
        highest[1] = n;
}
new string[100];
format(string, sizeof(string), "Highest value for option %d - value: %d", highest[1], highest[0]);
SendClientMessageToAll(0x999999AA, string);
something like this should work
(didn't test it, just wrote it up)
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)