PAWN Language Array has not supported index jump?

135 Views Asked by At

Three lines descriptions.

  1. make Array
  2. try to index jump [index(enum) + 1] for empty data
  3. compile output warning!!! but working good -_-;;;

is that correct way for pawn language?

~~~~.pwn(46) : warning 213: tag mismatch
Header size:           3720 bytes
Code size:            67016 bytes
Data size:         192587988 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1309 cells (5236 bytes)
Total requirements:192675108 bytes

Assume that this code follow bellow.

enum E_SOMETHINGS
{
 VAR_1,
 VAR_2,
 VAR_3,
 VAR_4
}
new VARIABLE[MAX_PLAYERS][E_SOMETHINGS];

enum MODEL_DATA
{
 MODEL_ID,
 NAME[DWORD]
};

new const ITEM_LIST[][MODEL_DATA] = 
{
 {0, "blah blah"},
 {1, "blah blah"},
 {2, "blah blah"},
 {3, "blah blah"}
};


function(){
 for (new i = 0; i < sizeof(ITEM_LIST); i++)
 {
   if (VARIABLE[playerid][i + VAR_1] <= 0)
     continue;

    printf("%i %s", ITEM_LIST[i][MODELID], ITEM_LIST[i][NAME]);
 }
}
                

RESULT

  1. output warning 213 : tag mismatch
  2. compile done
  3. working good. but i think this way is wrong.
~~~~.pwn(46) : warning 213: tag mismatch *IMPORTANT*
Header size:           3720 bytes
Code size:            67016 bytes
Data size:         192587988 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1309 cells (5236 bytes)
Total requirements:192675108 bytes
1

There are 1 best solutions below

0
On BEST ANSWER

advisory

Prepend _: to enumerate.

ex ) enum _:E_SOMETHINGS { VAR_1, VAR_2, VAR_3, VAR_4 }


Three lines descriptions.

  1. make Array
  2. try to index jump [index(enum) + 1] for empty data
  3. compile output warning!!! but working good -_-;;;

is that correct way for pawn language?

~~~~.pwn(46) : warning 213: tag mismatch
Header size:           3720 bytes
Code size:            67016 bytes
Data size:         192587988 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1309 cells (5236 bytes)
Total requirements:192675108 bytes

Assume that this code follow bellow.

enum E_SOMETHINGS
{
 VAR_1,
 VAR_2,
 VAR_3,
 VAR_4
}
new VARIABLE[MAX_PLAYERS][E_SOMETHINGS];

enum MODEL_DATA
{
 MODEL_ID,
 NAME[DWORD]
};

new const ITEM_LIST[][MODEL_DATA] = 
{
 {0, "blah blah"},
 {1, "blah blah"},
 {2, "blah blah"},
 {3, "blah blah"}
};


function(){
 for (new i = 0; i < sizeof(ITEM_LIST); i++)
 {
   if (VARIABLE[playerid][i + VAR_1] <= 0)
     continue;

    printf("%i %s", ITEM_LIST[i][MODELID], ITEM_LIST[i][NAME]);
 }
}
                

RESULT

  1. output warning 213 : tag mismatch
  2. compile done
  3. working good. but i think this way is wrong.
~~~~.pwn(46) : warning 213: tag mismatch *IMPORTANT*
Header size:           3720 bytes
Code size:            67016 bytes
Data size:         192587988 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1309 cells (5236 bytes)
Total requirements:192675108 bytes