29.10.2014, 12:32
pawn Код:
CMD:richlist(playerid, params[])
{
mysql_query("SELECT `username`, `money` FROM `data` WHERE `PlayerBanned`=0 ORDER BY `money` DESC LIMIT 10");
mysql_store_result();
printf("debug note 1");
new ID, output[800], string[256];
printf("debug note 2");
while(mysql_retrieve_row())
{
ID ++;
printf("debug note 3 ID %d", id);
new username[24], moneyvariable;
printf("debug note 4 ID %d", id);
mysql_fetch_field_row(username, "user");
mysql_fetch_field_row(string, "money"); moneyvariable = strval(string);
printf("debug note 5 ID %d", id);
format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, moneyvariable);
printf("debug note 6 ID %d", id);
}
mysql_free_result();
printf("debug note 7");
ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "Top 10 Players", output, "OK", "Cancel");
printf("debug note 8");
return 1;
}

