SA-MP Forums Archive
get the highest bounty - 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: get the highest bounty (/showthread.php?tid=197758)



get the highest bounty - Ribber - 10.12.2010

ok how can i order that it sorts the bounty by the highest value?!

i tried some things, but all doesn't worked correctly:

pawn Код:
if(strcmp(cmd,"/bounties",true)==0)
    {
        new List[MAX_PLAYERS][2];
        new count;
        foreach(Player,i)
        {
            if(bounty[i] > 0)
            {
                List[count][0] = i; // Get the IDs
                List[count][1] = bounty[i]; // Get the BOUNTYs
                count++;
            }
        }
        if(count == 0) return SendClientMessage(playerid,_COLOR_WHITE,"There are not any bounties at the moment.");
        else
        {
            for(new i = 0; i < count; i++)
            {
                if(List[i][1] < List[i+1][1])
                {
                    format(string,sizeof string,"%s (%d) : $%d", PlayerName( List[i][0] ), List[i][0], bounty[ List[i][0] ]*1000);
                    SendClientMessage(playerid,_COLOR_YELLOW,string);
                }
            }
        }
        return 1;
    }

please help!