23.11.2016, 13:36
(
Последний раз редактировалось TracerX; 23.11.2016 в 18:51.
)
removed, thanks stinged
new
query[42 + TABLE NAME LENGTH HERE]; // Just replace the whole size by the actual size (add 42 + length by yourself)
mysql_format(handle, query, sizeof (query), "SELECT COUNT(*) FROM `TABLE_NAME_HERE` WHERE `Gang` = %i", GANG_ID);
mysql_tquery(handle, query, "getGangCount", "ii", playerid, GANG_ID);
// Outside of the callback
forward getGangCount(playerid, gangid);
public getGangCount(playerid, gangid)
{
new
count;
cache_get_value_index_int(0, 0, count);
if (count == 100)
{
// There are 100 players in that gang
}
else
{
// There are less than a 100 players, so the player can join
}
}
mysql_tquery(handle, query, "getGangCount", "iii", playerid, player, GANG_ID);
// Outside of the callback
forward getGangCount(playerid, player, gangid);
public getGangCount(playerid, player, gangid)