[MySQL R40] Top 5 players
#1

ay

Код:
if(!strcmp(cmd, "/top", true))
{
    new query[128];
    mysql_format(SQL, query, sizeof(query), "SELECT * FROM `users` ORDER BY 'score' DESC LIMIT 3");
    mysql_tquery(SQL, query, "ScoreTopFive", "i", playerid);
    return 1;
}

forward ScoreTopFive(playerid);
public ScoreTopFive(playerid)
{
    new string[128];
    new name[25], score;

    for(new i = 0; i < rows; i ++)
    {
	    cache_get_value_name(i, "username", name);
	    cache_get_value_int(i, "score", score);

    	    format(string, 128, "%d. %s - %d", i+1, name, score);
    	    SendClientMessage(playerid, -1, string);
    }
    return 1;
}
This isn't working. Anyone that is familliar with the new MySQL versions enough to make this work?
Reply


Messages In This Thread
[MySQL R40] Top 5 players - by ranme15 - 03.10.2016, 17:22
Re: [MySQL R40] Top 5 players - by Shinja - 03.10.2016, 17:49
Re: [MySQL R40] Top 5 players - by ranme15 - 03.10.2016, 17:50
Re: [MySQL R40] Top 5 players - by Konstantinos - 03.10.2016, 18:19
Re: [MySQL R40] Top 5 players - by ranme15 - 03.10.2016, 18:40

Forum Jump:


Users browsing this thread: 1 Guest(s)