Error: Array must be indexed.
#1

Hello, earlier today I made a gas leak system.

I have an enum etc, but I'm receiving array should be indexed errors.
Here is an example line that is receiving the error:
Код:
GasInformation[GasType] = 1;
Here is the enum:
Код:
enum glInfo
{
	GasType[3],
    GasObjects[5],
    GasSize = 100,
    GasLeak = false
}
new GasInformation[glInfo];
Reply
#2

for(new i=0; i<3; i++)
{
GasType[i];
}
new gast = GasType[i]
GasInformation[gast] = 1
Reply
#3

Enums don't work like that! You can't assign default values in enums.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Enums don't work like that! You can't assign default values in enums.
Can you show me how to make this work?
Reply
#5

pawn Код:
new GasType[3], GasObjects[5], GasSize = 100, bool:GasLeak = false;
Reply
#6

These values are global?

if yes why not set the values in OnGamemodeInit for every var?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)