19.03.2013, 14:17
(
Последний раз редактировалось David94; 12.02.2016 в 18:12.
)
aaaaaaaaaaaaaaaa
CMD:ranks(playerid, params[])
{
new query[256];
format(query, sizeof(query), "SELECT * FROM `playerdata` ORDER BY `score` DESC LIMIT 5");
mysql_function_query(DBHANDLE, query, true, "DisplayRanks", "i", playerid);
return 1;
}
forward DisplayRanks(playerid);
public DisplayRanks(playerid)
{
new rows, fields, row = 0, str[128];
new kills, name[MAX_PLAYER_NAME];
cache_get_data(rows, fields, DBHANDLE);
if(rows)
{
while(row < rows)
{
cache_get_row(row, NameRowNumber, name, dbHandle, 128);
kills = cache_get_row_int(row, KillsRowNumber);
format(str, sizeof(str), "[Rank %d] %s, Kills: %d", row+1, name, kills);
SendClientMessage(playerid, -1, str);
}
}
else return SendClientMessage(playerid, -1, "No ranks to show up.");
return 1;
}