SA-MP Forums Archive
Get Highest Variable? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Get Highest Variable? (/showthread.php?tid=305857)



Get Highest Variable? - Admigo - 24.12.2011

Heey all,
How can i detect the highest variable from all players that is connected?

Thanks Admigo


Re: Get Highest Variable? - [ABK]Antonio - 24.12.2011

What variable are you trying to get? Do you mean value from the variable or what?


Re: Get Highest Variable? - Admigo - 24.12.2011

Yeah,i need the highest value.


Re: Get Highest Variable? - Ash. - 24.12.2011

How do you declare the variable(s)?


Re: Get Highest Variable? - Admigo - 24.12.2011

I just want to make a poker system. So i want a variable pokerpoint or something = value.


Re: Get Highest Variable? - Ash. - 24.12.2011

So loop through all the players on a table and get the highest value?


Re: Get Highest Variable? - Admigo - 24.12.2011

Yeah:P


Re: Get Highest Variable? - Rob_Maate - 24.12.2011

pawn Код:
new CurrentHighest = 0;
new HighestPlayerID;
for(new i=0; i<MAX_PLAYERS; i++)
{
    if (pokerpoint[i] > CurrentHighest)
    {
        HighestPlayerID = i;
        CurrentHighest = pokerpoint[i];
       
    }
}