TopScoreCreate
#3

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)
        }
    }
}
I was pleasantly surprised that this works


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]'
Reply


Messages In This Thread
TopScoreCreate - by BlackWolf120 - 06.01.2011, 05:27
Re: TopScoreCreate - by DarrenThayer - 06.01.2011, 08:21
Re: TopScoreCreate - by Joe Staff - 06.01.2011, 08:36
Re: TopScoreCreate - by DarrenThayer - 06.01.2011, 08:39
Re: TopScoreCreate - by BlackWolf120 - 06.01.2011, 18:21
Re: TopScoreCreate - by BlackWolf120 - 08.01.2011, 22:37
Re: TopScoreCreate - by MadeMan - 08.01.2011, 23:48
Re: TopScoreCreate - by BlackWolf120 - 10.01.2011, 18:10
Re: TopScoreCreate - by BlackWolf120 - 11.01.2011, 16:43
Re: TopScoreCreate - by BlackWolf120 - 14.01.2011, 17:58

Forum Jump:


Users browsing this thread: 7 Guest(s)