Ranking Players
#6

Quote:
Originally Posted by dominik523
Посмотреть сообщение
I have no idea what you wrote in that code.

Sorting an array which contains all players with quicksort would be a good idea:
http://forum.sa-mp.com/showpost.php?...postcount=1737
With my code, the first one that takes the last cp is the winner and so the global variable "win" increase by one; so the second one that takes the last cp is the second and the global variable "win" will again increase by one and so on..

So if you want to store the names is quite simple.. Create an other global variable such us:
pawn Код:
new Ranking[3];// arrays contained are 0 1 2

pawn Код:
switch(win)
            {
                new name[24];
                GetPlayerName(playerid,name,sizeof name);
                case 0:
                {
                    win++;
                    Ranking[0] = name;
                                        //player has won the race
                }
                case 1:
                {
                    win++;
                    Ranking[1] = name;
                                        //player is second
                }
                case 2:
                {
                    win++;
                    Ranking[2] = name;
                                        //player is third
                }
            }
I think that in this way the script will works fine although I don't tested it
Reply


Messages In This Thread
Ranking Players - by Max_Andolini - 25.01.2015, 18:33
Re: Ranking Players - by ReshiramZekrom - 25.01.2015, 21:52
Re: Ranking Players - by Max_Andolini - 26.01.2015, 06:30
Re: Ranking Players - by dominik523 - 26.01.2015, 08:30
Re: Ranking Players - by Max_Andolini - 26.01.2015, 09:33
Re: Ranking Players - by ReshiramZekrom - 26.01.2015, 12:53

Forum Jump:


Users browsing this thread: 1 Guest(s)