15.03.2018, 23:43
PHP код:
CMD:top(playerid, params[])
{
if(LoggedIn[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "ERROR: You must be logged in.");
mysql_query(MySQL, "SELECT `User`, `Kills` FROM `UserData` ORDER BY `Kills` DESC LIMIT 5");
mysql_store_result();
new string[128], pName[24], pKills[5], query[256];
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row_format(query, "|"))
{
mysql_fetch_field_row(pName, "User");
mysql_fetch_field_row(pKills, "Kills");
format(string, sizeof(string), "User: %s. Kills: %i", pName, pKills);
SendClientMessage(playerid, COLOR_RED, string);
}
}
mysql_free_result();
return 1;
}