• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] TOP 10 MySQL list
#2
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 
inum cache_num_rows(); numi++)
    {
        
cache_get_value_name(i"Username"username);
        
cache_get_value_name_int(i"Score"scorevariable);
        
format(outputsizeof(output), "%s%i. %s - %i score\n",outputi+1usernamescorevariable);
    }
    return 
ShowPlayerDialog(playerid,1945,0,"Score top list",output,"Close","");

  Reply


Messages In This Thread
TOP 10 MySQL list - by Blood - 2024-06-30, 04:52 PM
RE: TOP 10 MySQL list - by PainFrenemy - 2024-07-28, 07:12 PM

Forum Jump: