12.11.2013, 12:36
Debug the code to a few pieces, to help you find out which number didn't get called. (take a look in the server console)
pawn Код:
COMMAND:top(playerid, params[])
{
new
Query[160],
count = 10,
result[2][32],
stringt[(24 + 10) * 10];
print("1");
mysql_format(gSQL, Query, "SELECT `Score`, `PlayerName` FROM `"#MYSQL_TABLE"` ORDER BY `Score` ASC LIMIT 10");
mysql_function_query(gSQL, Query, true, "LoadPlayer", "d", playerid);
print("2");
if (mysql_num_rows() < 1) return 0;
print("3");
while (mysql_retrieve_row() && count > 0)
{
mysql_fetch_field_row(result[0], "Score");
mysql_fetch_field_row(result[1], "PlayerName");
print("4");
format(stringt, sizeof(stringt), "%s%d. %s: %d\n", stringt, count--, result[1],strval(result[0]));
}
ShowPlayerDialog(playerid, 1223, DIALOG_STYLE_MSGBOX, "Top 10", stringt, "Close", "");
print("5");
return 1;
}