Array does not load from .INC file - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Array does not load from .INC file (
/showthread.php?tid=97927)
Array does not load from .INC file -
TMasters - 17.09.2009
I'm making an admin system. First thing that i made is a INC file that will connect all Filterscripts and Gammode. Every Filterscript HAS included my INC file.
Ok hers my problem:
I got array aLevel[MAX_PLAYERS]; that is as you assume admin level. In one, of 7 FS, Functions OsAmdin,IsAdminLevel,IsAdminLevelMin will not work, and problem is that the array is not loaded to the function. Other filterscript where those functions work, array is loaded
any suggestion what could the problem b, how to fix it?
I've been bothering with this for a hour, tried some things, tested like 20 of things, nothing works
CODE in include
Код:
new aLevel[MAX_PLAYERS];
stock IsAdmin(playerid)
{
if (aLevel[playerid]>0) return 1; else return 0;
}
stock IsAdminLevel(playerid,level)
{
if (aLevel[playerid]==level) return 1; else return 0;
}
stock IsAdminLevelMin(playerid,level)
{
if (aLevel[playerid]>=level) return 1; else return 0;
}
stock SetAdminLevel(playerid,level)
{
return aLevel[playerid]=level;
}
Re: Array does not load from .INC file -
TMasters - 17.09.2009
OK, i got question.
If i load the INCLUDE multiple times in all FS,
>>> does the array work as 1st one
>>> with every load resets old array
>>> does it make completely new another array that works in same time as old array.
Cause if those arrays wont work ill make a file loading thing instead of this arrays
Re: Array does not load from .INC file -
Donny_k - 17.09.2009
Go read up on ****** about include files dude, they are easy to understand.
If you want a core file then create one filter which stores your array and grab the values using a remote call, just make sure your functions for grabbing the data from in the core are 'public' types.
You would do this by using 'CallRemoteFunction' so take a look on the wiki for information in that or search here as it's been discussed.
Re: Array does not load from .INC file -
TMasters - 18.09.2009
Use CallRemoteFunction for other things, never got idea that i could use it for this