Command lags the whole server
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
GROUP BY does that! Just try it already!
I've tried this:

Код:
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;
}
But it doesn't work. :<
Reply


Messages In This Thread
Command lags the whole server - by danielpalade - 10.01.2017, 00:12
Re: Command lags the whole server - by BiosMarcel - 10.01.2017, 00:29
Re: Command lags the whole server - by danielpalade - 10.01.2017, 01:40
Re: Command lags the whole server - by Lordzy - 10.01.2017, 01:55
Re: Command lags the whole server - by BiosMarcel - 10.01.2017, 15:45
Re: Command lags the whole server - by danielpalade - 10.01.2017, 16:51
Re: Command lags the whole server - by Vince - 10.01.2017, 17:12
Re: Command lags the whole server - by danielpalade - 10.01.2017, 17:19
Re: Command lags the whole server - by Vince - 10.01.2017, 21:21
Re: Command lags the whole server - by danielpalade - 10.01.2017, 22:10

Forum Jump:


Users browsing this thread: 3 Guest(s)