2024-07-28, 07:12 PM
(This post was last modified: 2024-07-28, 07:15 PM by PainFrenemy.)
PHP Code:
CMD:check(playerid)
{
mysql_tquery(mysql, "SELECT `Score`, `User` FROM `table` WHERE `Score` != 0 ORDER BY `Score` DESC LIMIT 10", "ShowTOP10", "d", playerid);
}
forward ShowTOP10(playerid);
public ShowTOP10(playerid)
{
if(!cache_num_rows()) return 0;
new output[600];
static username[MAX_PLAYER_NAME];
for(new i, num = cache_num_rows(); i < num; i++)
{
cache_get_value_name(i, "Username", username);
cache_get_value_name_int(i, "Score", scorevariable);
format(output, sizeof(output), "%s%i. %s - %i score\n",output, i+1, username, scorevariable);
}
return ShowPlayerDialog(playerid,1945,0,"Score top list",output,"Close","");
}