17.06.2010, 20:12
pawn Code:
new List[MAX_PLAYERS][2];
new count;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
List[count][0] = i;
List[count][1] = GetPlayerScore(i);
count++;
}
}
pawn Code:
new done, temp;
do
{
done = 1;
for(new i=0; i < count-1; i++)
{
if(List[i][1] < List[i+1][1])
{
done = 0;
temp = List[i][0];
List[i][0] = List[i+1][0];
List[i+1][0] = temp;
temp = List[i][1];
List[i][1] = List[i+1][1];
List[i+1][1] = temp;
}
}
}
while(!done);
place playeridscore
1List[0][0] List[0][1]
2List[1][0]List[1][1]
3List[2][0]List[2][1]
... and so on.