[+REP] Array in Enum
#1

Hello everyone,

I've wanted to use an int array in an enum, and I got no errors when I compiled. But when in an if statement in somewhere in the code, I used the array to check its value, and then four errors showed up.

I really need to solve this problem, if you have an idea how to fix this thing, then help me fix it, please.


Here's the enum:
PHP код:
enum objectenum
{
        
created,
        
objectID,
        
modelID,
        
matindex[5]
};
new 
oInfo[MAX_PLAYERS][MAX_CREATED_OBJECTS][objectenum]; 
Here's the if statement:
PHP код:
if(oInfo[playerid][i][matindex[0]] == 0
And here's the error:
Код:
C:\Program Files (x86)\SA-MP Server\filterscripts\modpaw.pwn(348) : error 028: invalid subscript (not an array or too many subscripts): "matindex"
C:\Program Files (x86)\SA-MP Server\filterscripts\modpaw.pwn(348) : warning 215: expression has no effect
C:\Program Files (x86)\SA-MP Server\filterscripts\modpaw.pwn(348) : error 001: expected token: ";", but found "]"
C:\Program Files (x86)\SA-MP Server\filterscripts\modpaw.pwn(348) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\SA-MP Server\filterscripts\modpaw.pwn(348) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply


Messages In This Thread
[+REP] Array in Enum - by Viggo - 28.01.2018, 13:22
Re: [+REP] Array in Enum - by Viggo - 28.01.2018, 13:24
Re: [+REP] Array in Enum - by GalKiller - 28.01.2018, 15:30
Re: [+REP] Array in Enum - by iSteve - 28.01.2018, 15:32
Re: [+REP] Array in Enum - by Hrb - 28.01.2018, 15:35
Re: [+REP] Array in Enum - by Viggo - 28.01.2018, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)