Multidimensional array error ( 3D )
#1

pawn Код:
// Top of the script
enum mE
{
    Float:POS[3],
    Int
}
new TD[MAX_PLAYERS][mE][5];

// OnGameModeInit
TD[0][POS[0]][0] = 1.0; // error 028: invalid subscript (not an array or too many subscripts): "POS"
Reply
#2

I'm not sure for the last array. It'd be:
pawn Код:
TD[0/*playerid*/][POS][0][0] = 1.0;
But I'm not sure if it supports that many arrays.
Reply
#3

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
I'm not sure for the last array. It'd be:
pawn Код:
TD[0/*playerid*/][POS][0][0] = 1.0;
But I'm not sure if it supports that many arrays.
I don't think that's gonna work, try to focus on the arrays
Reply
#4

Quote:
Originally Posted by DeMoX
Посмотреть сообщение
But why there's 'playerid' ?
It was a comment that the first 0 is supposed to be the playerid in other callbacks!
Reply
#5

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
I'm not sure for the last array. It'd be:
pawn Код:
TD[0/*playerid*/][POS][0][0] = 1.0;
But I'm not sure if it supports that many arrays.
Still not working
Reply
#6

Quote:
Originally Posted by saamp
Посмотреть сообщение
Still not working
Quote:
Originally Posted by _Zeus
Посмотреть сообщение
But I'm not sure if it supports that many arrays.
It's not possible then.
Reply
#7

It is not allowed in PAWN, use:
pawn Код:
enum {
PosX,
PosY,
Posz
};
Reply
#8

Quote:
Originally Posted by Hanger
Посмотреть сообщение
It is not allowed in PAWN, use:
pawn Код:
enum {
PosX,
PosY,
Posz
};
That's not the problem. The last array is wrong only.

pawn Код:
enum mE
{
    Float:POS[3],
    Int
}
new TD[MAX_PLAYERS][mE];

// OnGameModeInit
TD[0][POS][0] = 1.0;
TD[0][POS][1] = 1.0;
TD[0][POS][2] = 1.0;
That's correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)