My current command is like this:
PHP код:
COMMAND:topgang(playerid, params[])
{
new query[128];
mysql_format(connection, query, sizeof(query), "SELECT * FROM `cnr_gang` ORDER BY `score` DESC LIMIT 20");
mysql_query(connection, query, true);
new ganglist[2500], count = cache_num_rows(), TempColor[7], TempName[30];
if(count != 0)
{
for(new i = 0; i < count; i++)
{
cache_get_field_content(i, "color", TempColor);
cache_get_field_content(i, "name", TempName);
new gangkills = cache_get_field_content_int(0, "Kills");
new gangdeaths = cache_get_field_content_int(0, "Deaths");
format(ganglist, sizeof(ganglist), "%s%d. {%s}%s {FFFFFF}- Score : %d \t\t\t\t{23ffaa}Gang Kills: %d \tGang Deaths: %d\n", ganglist, (i+1), TempColor, TempName, cache_get_field_content_int(i, "score"), gangkills, gangdeaths);
}
format(ganglist, sizeof(ganglist), "%s\n* This top list updated every %d minutes", ganglist, AUTOSAVE);
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Top Gangs", ganglist, "Close", "");
}
else
SendClientMessage(playerid, -1, "{FF0000}There's no gangs present!");
return 1;
}
So can i do it like:
PHP код:
format(ganglist, sizeof(ganglist), "%s\n Gang Name\tGang Score\tGang Kills\tGang Deaths\n\",ganglist);
PHP код:
format(ganglist, sizeof(ganglist), "%s {%s}%s \t{FFFFFF}%d\t{23ffaa}%d \t%d\n\", ganglist, TempColor, TempName, cache_get_field_content_int(i, "score"), gangkills, gangdeaths);
format(ganglist, sizeof(ganglist), "%s\n* This top list updated every %d minutes", ganglist, AUTOSAVE);
PHP код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_TABLIST_HEADERS, "Top Gangs",ganglist, "Select", "Cancel");
?