14.02.2016, 12:37
Hello,
i got the following code.
I want to get the top 5 players ordered by score, and use them in a format. How to assign the stuff from the database to the variables "name" and "score"?
i got the following code.
I want to get the top 5 players ordered by score, and use them in a format. How to assign the stuff from the database to the variables "name" and "score"?
Код:
CMD:top(playerid, params[])
{
new query[500];
new name[5][24];
new score[5][10];
new num;
mysql_format(mysql, query, sizeof(query), "SELECT name, score FROM accounts ORDER BY score DESC LIMIT 5");
mysql_tquery(mysql, query, "");
cache_get_field_content(0, "name", name);
score = cache_get_field_content_int(0, "score", mysql);
return 1;
}

