Top score player
#2

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:

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;
}
Reply


Messages In This Thread
Top score player - by ,TomY' - 20.08.2018, 15:19
Re: Top score player - by KinderClans - 20.08.2018, 16:38
Re: Top score player - by ,TomY' - 20.08.2018, 16:39
Re: Top score player - by KinderClans - 20.08.2018, 16:41
Re: Top score player - by ,TomY' - 20.08.2018, 17:59
Re: Top score player - by ,TomY' - 20.08.2018, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)