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



enums.. - 2KY - 18.08.2012

Is something like this possible?

pawn Код:
enum pVars
{
                        //snip.
            ClassWeapon [ MAX_CLASSES ] [ MAX_TEAMS ],
                        //snip.
}
Where "MAX_CLASSES" is defined as 3 (0,1,2) and "MAX_TEAMS" is defined as 2 (0,1). It's currently giving me an error

Quote:

my.pwn(130) : error 001: expected token: "}", but found "["

If someone could point me in the right direction, that'd be great.


Re: enums.. - leonardo1434 - 18.08.2012

enum does not support array 2d's or above, at least i don't know how to make it working.


Re: enums.. - 2KY - 18.08.2012

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
enum does not support array 2d's or above, at least i don't know how to make it working.
Alright, thanks anyways.


Re: enums.. - Arca - 18.08.2012

Quote:
Originally Posted by 2KY
Посмотреть сообщение
Is something like this possible?

pawn Код:
enum pVars
{
                        //snip.
            ClassWeapon [ MAX_CLASSES ] [ MAX_TEAMS ],
                        //snip.
}
Where "MAX_CLASSES" is defined as 3 (0,1,2) and "MAX_TEAMS" is defined as 2 (0,1). It's currently giving me an error



If someone could point me in the right direction, that'd be great.
You should make different array to hold that. As the above poster said, enumerators doesn't supports multi-dimensional array.