/leaders - список лидеров
C++:
CMD:leaders(playerid)
{
new fmt_text[128],
text[1440],
Cache: result,
rows;
result = mysql_query(mysql, "SELECT * FROM `accounts` WHERE `admin` = 0 AND `job` = 10 ORDER BY team ASC", true);
rows = cache_num_rows();
format(text, sizeof text, "{3399FF}№ фракции\tИмя\t\t\t\tФракция{FFFFFF}");
for(new i = 0; i < rows; i++)
{
new name[21],
user_id = cache_get_field_content_int(i, "id"),
team = cache_get_field_content_int(i, "team");
cache_get_field_content(i, "name", name);
format(fmt_text, sizeof fmt_text, "\n%d\t\t%s%s\t%s", team, name, strlen(name) > 14 ? "\t" : "\t\t", GetTeamName(team));
strcat(text, fmt_text);
SetPlayerListitemValue(playerid, i+1, user_id);
}
cache_delete(result);
Dialog(playerid, INVALID_DIALOG_ID, DIALOG_STYLE_MSGBOX, "{FFD83D}Список лидеров", text, "Закрыть", "");
return 1;
}