10.01.2017, 22:10
I've tried this:
But it doesn't work. :<
Код:
CMD:factions(playerid, params[]) { new Cache: r, rows, small[128], string[2000], query[256], members, factionId, memberCount[sizeof(E_GROUP)]; r = mysql_query(dbHandle, "SELECT Member AS factionId, COUNT(*) AS memberCount FROM players GROUP BY Member", true); rows = cache_num_rows(); for (new c = 0; c < rows; c++) { factionId = cache_get_row_int(c, 0); memberCount[factionId] ++; } cache_delete®; format(small, sizeof(small), "Faction\tSlots\n"); for(new i; i < sizeof(E_GROUP); i++) { format(string, sizeof(string), "%s%s\t%d/%d", small, E_GROUP[i][gName], memberCount[i], E_GROUP[i][gSlots]); } ShowPlayerDialog(playerid, DIALOG_FACTIONS, DIALOG_STYLE_TABLIST_HEADERS,"Factions", string, "Select", "Cancel"); return 1; }