18.08.2015, 07:55
Код:
COMMAND:top10(playerid, params[]) { mysql_query("SELECT `playerName`, `playerXP` FROM `playerdata` WHERE `playerXP` > 0 ORDER BY `playerXP` DESC LIMIT 10"); mysql_store_result(); if(mysql_num_rows() > 0) { new playerName[MAX_PLAYER_NAME], playerXP, i = 1, szMessage[640], szReturn[640]; while(mysql_fetch_row(szReturn)) { sscanf(szReturn, "p<|>s[120]d", playerName, playerXP); format(szMessage, sizeof(szMessage), "%d. %s - %d XP", i, playerName, playerXP); SendClientMessage(playerid, -1, szMessage); i++; } return mysql_free_result(); } return 1; }