10.04.2011, 14:27
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:
I hope you can help me.
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;
}