MySQL - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL (
/showthread.php?tid=622517)
MySQL -
TracerX - 23.11.2016
removed, thanks stinged
Re: MySQL -
Stinged - 23.11.2016
PHP код:
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
}
}
Re: MySQL -
TracerX - 23.11.2016
thanks stinged
Re: MySQL -
Stinged - 23.11.2016
PHP код:
mysql_tquery(handle, query, "getGangCount", "iii", playerid, player, GANG_ID);
// Outside of the callback
forward getGangCount(playerid, player, gangid);
public getGangCount(playerid, player, gangid)
Re: MySQL -
TracerX - 23.11.2016
Thank you so much.
Re: MySQL -
Vince - 23.11.2016
Fuck, I'm going to keep a list of ungrateful people who delete their post after having received the answer. This is a public forum, not your personal helpdesk. If you don't want to share your code, don't post.