SA-MP Forums Archive
Variable in Include - 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: Variable in Include (/showthread.php?tid=613609)



Variable in Include - Shinja - 29.07.2016

PHP код:
stock IsPlayerInAnyClan(playeridvalue)
{
    if(
value[playerid] == -1) return false;
    else return 
true;

i'm using this stock in an .inc
Example use
PHP код:
new pClan[MAX_PLAYERS]; 
PHP код:
OnRegister(playeridpClan[playerid] = -1
PHP код:
if(IsPlayerInAnyClan(playeridpClan))... 
It should do
PHP код:
if(pClan[playerid] == -1) return false;
    else return 
true
But seems
Код:
IsPlayerInAnyClan(playerid, value)
Код:
value
Doesn't stock pClan

How to do it? i already tried many formats like value[], const value... nothing
Please help, thanks!


Re: Variable in Include - Misiur - 29.07.2016

I'd say, why not just do it easier way:

pawn Код:
stock IsPlayerInAnyClan(playerid)
{
    return pClan[playerid] != -1;
}

//then
IsPlayerInAnyClan(playerid)



Re: Variable in Include - Shinja - 29.07.2016

Then i have to get the pClan variable to the include from database so i have to add mysql_connect again and many shits..