Scoreboard, sorted from highest, to lowest score.
#1

I'm trying to make a scoreboard like this for awhile, but I can't find a method to make this.
I'm creating a scoreboard, with textdraws. But first of all I'm trying to get a top 10 ranking.

I tried different methods. Example method, which fails, but I'm just trying to tell you what I mean:
pawn Код:
new TopScore[10];
stock SortPlayers()
{
    new string[128];
    foreach(Player, i)
    {
        if(GetPlayerScore(i) > 1)
        {
            format(string, sizeof(string), "1. %s    | Score: %i | Deaths: %i", PlayerName(i), GetPlayerScore(i), GetPlayerDeaths(i));
            TopScore[1] = GetPlayerScore(i);
            TextDrawSetString(Textdraw1, string);
        }
        if(GetPlayerScore(i) < TopScore[1])
        {
            format(string, sizeof(string), "2. %s    | Score: %i | Deaths: %i", PlayerName(i), GetPlayerScore(i), GetPlayerDeaths(i));
            TopScore[2] = GetPlayerScore(i);
            TextDrawSetString(Textdraw2, string);
        }
        if(GetPlayerScore(i) < TopScore[2])
        {
            format(string, sizeof(string), "3. %s    | Score: %i | Deaths: %i", PlayerName(i), GetPlayerScore(i), GetPlayerDeaths(i));
            TopScore[3] = GetPlayerScore(i);
            TextDrawSetString(Textdraw3, string);
         }
    }
return 1;
}
I hope you can help me.
Reply
#2

Ryderґ made something like that a while back, lemme search for it.
Edit: THIS might help you..
Reply
#3

Thank you, I will try something with that.

Edit: I got it working, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)