Case needs to be const
#1

Hi!
I have this:
Код:
	switch(objectid) {
	case GateObject[0]: {
	if(GateOpened[0] == true) {
	MoveObject(GateObject[0], -48.768456, 27.114319, 1.604109, 3.5);
	GateOpened[0] = false;
	}
	}
       }
An error pop up saying that must be a constant expression; assumed zero
Is it possible to get here a constant value, if the objectid of GateObject[0] is gotten in OnGamemodeInit?
Reply
#2

Try using the array value for cases
Reply
#3

pawn Код:
switch(GateObject) {
      case 0: {
        if(GateOpened[0] == true) {
          MoveObject(GateObject[0], -48.768456, 27.114319, 1.604109, 3.5);
          GateOpened[0] = false;
        }
      }
    }
Reply
#4

Код:
	switch(GateObject) {
	case 0: {
	if(GateOpened[0] == true) {
	MoveObject(GateObject[0], -48.768456, 27.114319, 1.604109, 3.5);
	GateOpened[0] = false;
	}
	}
       }
It gives still an error: error 033: array must be indexed (variable "-unknown-")
How can I index an array?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)