06.01.2011, 08:36
pawn Код:
new TotalScores[15];
new PlayerScore[2];
for(new player;player<MAX_PLAYERS;player++)
{
PlayerScore[0]=GetPlayerScore(player);
for(new place;place<sizeof(TotalScores);place++)
{
if(PlayerScore[0]>TotalScores[place])
{
strins(TotalScores,PlayerScore,place);
place=sizeof(TotalScores); //Stop the second loop (place)
}
}
}
It works by turning the player's score into a string (PlayerScore[2]), it has to be '[2]' because the last spot is a place holder for 'NULL' which makes it a string, then I used the 'strins' function to place the score into TotalScores[15], just be sure that TotalScores is 1 more larger in size than what you want, so for 15 players you should put '[16]'