I have this const:
PHP Code:
new const PRIMARY[ ][ ] = {
"weapon_m4a1", // Gun ID - 1
"weapon_ak47", // Gun ID - 2
"weapon_m3", // Gun ID - 3
"weapon_xm1014", // Gun ID - 4
"weapon_aug", // Gun ID - 5
"weapon_mac10", // Gun ID - 6
"weapon_ump45", // Gun ID - 7
"weapon_mp5navy", // Gun ID - 8
"weapon_p90", // Gun ID - 9
"weapon_galil", // Gun ID - 10
"weapon_famas" // Gun ID - 11
};
and I need that from another const:
PHP Code:
new const allowed_primary[ ] = { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11 }
Would print into menu only those ids which are in const:
PHP Code:
for( i_prim = 0; i_prim < 8; i_prim++ ) {
p_id = ( ( _curr_page[ id ] * 8 ) + i_prim - 8 );
if( p_id < _totalguns )
len += formatex( data_holder[ len ], charsmax( data_holder ) - len, "^n \r%i\d. %s", i_prim + 1, P_NAMES[ allowed_primary[ p_id ] ] );
}
But I get index out of bounds here:
PHP Code:
P_NAMES[ allowed_primary[ p_id ] ]
Is there any other way to do this ?