20.08.2018, 16:38
Wait, you need to check the most higher score ONLINE or offline?
Because if is online, you don't need a mysql query, but just this:
Because if is online, you don't need a mysql query, but just this:
pawn Код:
CMD:scorelist(playerid)
{
new data[MAX_PLAYERS][2];
foreach (new i : Player)
{
data[i][0] = GetPlayerScore(i);
data[i][1] = i;
}
QuickSort_Pair(data, true, 0, Iter_Count(Player));
SendClientMessage(playerid, -1, "* Top 5 players with high score currently online:");
new buf[150];
for (new i; i < 5; i++)
{
if (data[i][0])
{
format(buf, sizeof(buf), "%i. %s (%i) - %i$", i + 1, ReturnPlayerName(data[i][1]), data[i][1], data[i][0]);
SendClientMessage(playerid, -1, buf);
}
}
return 1;
}