18.07.2011, 12:24
pawn Code:
mysql_query("SELECT `Name`, `Score` FROM `players` ORDER BY `Score` DESC LIMIT 10");
mysql_store_result();
new szPrepTD[460], iIterator = 1, iScore, szName[MAX_PLAYER_NAME], szUnload[64];
while(mysql_fetch_row_format(szUnload)) {
// This code will repeat ten times.
sscanf(szUnload, "p<|>sd", szName, iScore);
if(strlen(szPrepTD) == 0) format(szPrepTD, sizeof(szPrepTD), "#%d - %s (%d score)\n", iIterator, szName, iScore);
format(szPrepTD, sizeof(szPrepTD), "%s#%d - %s (%d score)\n", szPrepTD, iIterator, szName, iScore);
iIterator++;
}
mysql_free_result();