24.04.2016, 12:37
Код:
mysql_function_query(database, "SELECT * FROM `members` ORDER BY `score` DESC LIMIT 10", true, "ShowTop", "d", playerid);
Код:
forward ShowTop(playerid); public ShowTop(playerid) { new rows, fields; cache_get_data(rows, fields, database); if(!rows) return true; new szName[MAX_PLAYER_NAME],score[13]; new page[924]; page = "{8DF800}Rank\n{8DF800}Nickname\n{8DF800}Score\n"; for(new i = 0; i < rows; i++) { cache_get_field_content(i, "Nick", szName, database); cache_get_field_content(i, "score", score, database); format(page, 2024, "%s{FFFFFF}%d\t%s\t%d\n", page, (i+1), szName, strval(score)); } ShowPlayerDialog(playerid,0,DIALOG_STYLE_TABLIST_HEADERS,"Top Players",page,"ОК",""); return 1; }