How to do highscore?
#1

hii
i have a mysql saving system
and i want to retrieve uername and score and order it in an ascending order and first 10 should be shown in dialog
how to do it ? ?
Reply
#2

try to make like /admins command (if you know) but with a specific score to be in top
like for example to show players with score X or Y or Z
Reply
#3

SQLite bro
Reply
#4

PHP Code:
forward highscores(playerid);
public 
highscores(playerid)
{
    new 
query[512],results[400],title[64];
    
format(title,sizeof(title),"{00FF00}Highscores");
    
Num1[playerid] = 0;
    
Num2[playerid] = 12;
    
format(query,sizeof(query),"SELECT username,totalscore FROM `users` ORDER BY `totalscore` DESC LIMIT %d, %d"Num1[playerid], Num2[playerid]);
    
mysql_query(query);
    
mysql_store_result();
    new 
tRows mysql_num_rows();
    new 
vIDvModel;
    while(
mysql_fetch_row(query))
    {
        
sscanf(query"p<|>dd"vIDvModel);
        
format(results,sizeof(results),"%d | %s\n");
    }
    if(
tRows >= 12) { format(results,sizeof(results), "%sNext Page"results); }
    
ShowPlayerDialog(playerid9863DIALOG_STYLE_LIST,title,results,"Select""Back");
    
mysql_free_result();
    return 
1;

this codes is not working
Reply
#5

PHP Code:
SELECT `columnFROM `tableORDER BY `columnDESC LIMIT 1 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)