get the highest bounty
#1

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!
Reply


Messages In This Thread
get the highest bounty - by Ribber - 10.12.2010, 07:52

Forum Jump:


Users browsing this thread: 1 Guest(s)