08.07.2014, 03:09
pawn Код:
stock ShowTopKills()
{
new names[100],tKills[100],ID;
mysql_query("SELECT `Username`, `Kills` FROM `Accounts` ORDER BY `Kills` DESC LIMIT 5");
mysql_store_result();
while(mysql_retrieve_row())
{
new count = mysql_num_rows();
while(count != 0)
{
new username[24],pkills[80];
ID++;
count--;
mysql_fetch_field_row(username, "Username");
mysql_fetch_field_row(pkills, "Kills");
format(names, sizeof(names), "%s%d. i%s~n~~n~~n~", names, ID, username);
format(tKills, sizeof(tKills), "%d~n~~n~~n~",strval(pkills));
}
}
TextDrawSetString(Top1[0], names);
TextDrawSetString(Top1[1], tKills);
mysql_free_result();
return 1;
}