29.01.2015, 12:10
Something like this:
pawn Код:
forward OnTopScores(playerid);
public OnTopScores(playerid)
{
new full_info[500];
for(new row, rows = cache_get_row_count(mysql); row < rows; row ++)
{
new
username[MAX_PLAYER_NAME + 1],
score,
sub_info[50]
;
cache_get_field_content(row, "Username", username, mysql);
score = cache_get_field_content_int(row, "Scores", mysql);
format(sub_info, sizeof sub_info, "%02i. Username: %s, Score: %i\n", row + 1, username, score);
strcat(full_info, sub_info);
}
ShowPlayerDialog(playerid, DIALOG_TOPSTATS, DIALOG_STYLE_MSGBOX, "Top Scores", full_info, "Close", "");
return 1;
}