28.10.2014, 20:46
While using this command, the whole server crashes, is there anything wrong with this code?
pawn Код:
CMD:richlist(playerid, params[])
{
mysql_query("SELECT `username`, `money` FROM `data` WHERE `PlayerBanned`=0 ORDER BY `money` DESC LIMIT 10");
mysql_store_result();
new
ID,
output[800];
while(mysql_retrieve_row())
{
ID ++;
new
username[24],
moneyvariable[80];
mysql_fetch_field_row(username, "user");
mysql_fetch_field_row(moneyvariable, "money");
format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, strval(moneyvariable));
}
mysql_free_result();
ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "Top 10 Players", output, "OK", "Cancel");
return 1;
}