28.06.2014, 21:36
Hello, I found a working top10 system, but after some time when people are using /top10, then it just wont work anymore, database is up and everything.
Here's the code:
Here's the code:
pawn Код:
mysql_query("SELECT `Username`, `Score` FROM `Users` ORDER BY `Score` DESC LIMIT 10");
mysql_store_result();
new szPrepTD[1200], iIterator = 1, iScore, szName[MAX_PLAYER_NAME], szUnload[64];
while(mysql_fetch_row_format(szUnload)) {
sscanf(szUnload, "p<|>s[24]d", szName, iScore);
format(szPrepTD, sizeof(szPrepTD), "%s %d. %s - %d Score \n", szPrepTD, iIterator, szName, iScore);
iIterator++;
}
mysql_free_result();
ShowPlayerDialog(playerid, 8601, DIALOG_STYLE_MSGBOX, "TOP 10", szPrepTD, "Close", "");