SA-MP Forums Archive
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(handlequerysizeof (query), "SELECT COUNT(*) FROM `TABLE_NAME_HERE` WHERE `Gang` = %i"GANG_ID);
mysql_tquery(handlequery"getGangCount""ii"playeridGANG_ID);

// Outside of the callback
forward getGangCount(playeridgangid);
public 
getGangCount(playeridgangid)
{
    new
        
count;
    
cache_get_value_index_int(00count);
    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(handlequery"getGangCount""iii"playeridplayerGANG_ID);
// Outside of the callback
forward getGangCount(playeridplayergangid);
public 
getGangCount(playeridplayergangid



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.