SA-MP Forums Archive
About variables - 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: About variables (/showthread.php?tid=536995)



About variables - TheSimpleGuy - 13.09.2014

Well, we use player variables in our servers, something like: new Variable[MAX_PLAYERS].
I was just wondering, other servers, they could do: new Variable[MAX_GROUPS].
And they can do any names. I tried using new Variable[MAX_GROUPS] but it says MAX_GROUPS is undefined.


Re: About variables - Stinged - 13.09.2014

If you don't have a group system, it will not work.
You can #define MAX_GROUPS (amount) but, like I said, if you don't have a group system, it won't work.


Re: About variables - TheSimpleGuy - 13.09.2014

But... this won't work.
#define MAX_GROUPS 100
new Variable[MAX_GROUPS];
Variable[groupid] = 1;


Re: About variables - Stinged - 13.09.2014

Like I said, if you don't have a group system, it will not work.


Re: About variables - TheSimpleGuy - 13.09.2014

That is why I am creating a group system.


Re: About variables - Threshold - 13.09.2014

pawn Код:
#define MAX_GROUPS 100
new Variable[MAX_GROUPS];
These two lines alone will work. It all depends on where 'Variable[groupid] = 1;' is placed and what 'groupid' is defined as.


Re: About variables - RajatPawar - 13.09.2014

You can obviously define it, and then take a look at other group includes (ignore y_groups - it's too complicated at this level) to see how it is used.


Re: About variables - TheSimpleGuy - 13.09.2014

pawn Код:
#define MAX_GROUPS 100
new Variable[MAX_GROUPS];
CMD:variable(playerid, params[])
{
    Variable[groupid] = 1;
    return 1;
}
(1992) : error 017: undefined symbol "groupid"