04.06.2011, 16:49
You cant in pawn, you could use a 1d array with a little trick
This can be used like every 2d array, it is some nanoseconds slower through the calculation (also not worth to mention)
Or you set them in OnGameModeInit to their default value
Or in your example with a player based array in OnPlayerConnect
pawn Code:
new Text: PlayerFadeText[MAX_PLAYERS * MAX_FADES] = {INVALID_TEXT_DRAW, ...};
#define PlayerFadeText[%0][%1] PlayerFadeText[(%0) + (MAX_PLAYERS * (%1))]
//could be [(MAX_FADES * (%0)) + (%1)] but %0 wont be an constant => no preprocess
Or you set them in OnGameModeInit to their default value
pawn Code:
//OnGameModeInit
for(new i, j; i != sizeof PlayerFadeText; ++i) {
for(j = 0; j != sizeof PlayerFadeText[]; ++j) {
PlayerFadeText[i][j] = INVALID_TEXT_DRAW;
}
}
pawn Code:
//OnPlayerConnect
for(new i; i != sizeof PlayerFadeText[]; ++i) {
PlayerFadeText[playerid][i] = INVALID_TEXT_DRAW;
}