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;
}
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];
printf("debug note 2");
while(mysql_retrieve_row())
{
ID ++;
printf("debug note 3 ID %d", id);
new
username[24],
moneyvariable[80];
printf("debug note 4 ID %d", id);
mysql_fetch_field_row(username, "user");
mysql_fetch_field_row(moneyvariable, "money");
printf("debug note 5 ID %d", id);
format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, strval(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;
}
CMD:richlist(playerid, params[])
{
#pragma unused params
mysql_query("SELECT `username`, `money` FROM `data` WHERE `PlayerBanned` = 0 ORDER BY `money` DESC LIMIT 10");
mysql_store_result();
new ID = 0, output[800];
while(mysql_retrieve_row())
{
ID++;
new username[MAX_PLAYER_NAME], moneyvariable[80];
mysql_fetch_field_row(username, "user");
mysql_fetch_field_row(moneyvariable, "money");
format(output, sizeof(output), "%s %d. %s with %s dollars\n", output, ID, username, moneyvariable);
}
mysql_free_result();
return ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "Top 10 Players", output, "OK", "");
}
Well I've not spotted any errors directly, try and debug the code and look on your console for where the script is stopping (on server_log.txt)
pawn Код:
|
mysql_fetch_field_row(moneyvariable, "money");
printf("debug note 5 ID %d", id);
format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, strval(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");
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;
}
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");
format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, moneyvariable);