How to do highscore? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to do highscore? (
/showthread.php?tid=623609)
How to do highscore? -
bugmenotlol - 02.12.2016
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 ? ?
Re: How to do highscore? -
ImTouchk - 02.12.2016
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
Re: How to do highscore? -
BrianFaria - 02.12.2016
SQLite bro
Re: How to do highscore? -
bugmenotlol - 02.12.2016
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 vID, vModel;
while(mysql_fetch_row(query))
{
sscanf(query, "p<|>dd", vID, vModel);
format(results,sizeof(results),"%d | %s\n");
}
if(tRows >= 12) { format(results,sizeof(results), "%sNext Page", results); }
ShowPlayerDialog(playerid, 9863, DIALOG_STYLE_LIST,title,results,"Select", "Back");
mysql_free_result();
return 1;
}
this codes is not working
Re: How to do highscore? -
oMa37 - 02.12.2016
PHP Code:
SELECT `column` FROM `table` ORDER BY `column` DESC LIMIT 1