SA-MP Forums Archive
help please... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help please... (/showthread.php?tid=204561)



help please... - Lutsen - 29.12.2010

hi, i have a function to get the player's highest money, but how to get,after that, the 2nd player with the highest money? and not the first one again. Thanks.


Re: help please... - _rAped - 29.12.2010

You want to find the player with the most wealth?


Re: help please... - Lutsen - 29.12.2010

most money and the player with the most money after that.


Re: help please... - cessil - 29.12.2010

online?
pawn Код:
new topid,secondid,topcash,secondcash;
for(new i=0;i<MAX_PLAYERS;i++)
{
    if(GetPlayerMoney(i) > topcash)
    {
        topcash = GetPlayerMoney(i);
        topid = i;
    }
    if(GetPlayerMoney(i) > secondcash && i != topid)
    {
        secondcash = GetPlayerMoney(i);
        secondid = i;
    }
}