PHP Code:
const MAX_PLAYERS = 32
#define MAX_ENTS ( 900 + MAX_PLAYERS * 15 )
#define ENTS_ARRAY_SIZE ( MAX_ENTS / 32 ) + _:!!( MAX_ENTS % 32 )
new Float:g_fVelocity[ ENTS_ARRAY_SIZE ][ 3 ]
public CreateEnts()
{
new iEnt = create_entity( "info_target" )
pev( iEnt, pev_velocity, g_fVelocity[ iEnt ] ) // index out of bounds
}
public EntsThink( iEnt )
{
if( is_valid_ent( iEnt ) )
{
PrintVelocity( iEnt )
// set next think .. others
}
}
PrintVelocity( iEnt )
{
server_print( "print: %f %f %f", g_fVelocity[ iEnt ][ 0 ], g_fVelocity[ iEnt ][ 1 ], g_fVelocity[ iEnt ][ 2 ] )
}
I want to cache some values from custom entityes into a global, but i get
index out of bounds error.
It's not possible with
bits calculation ?
edit:
it's work if i used
PHP Code:
new Float:g_fVelocity[ MAX_ENTS ][ 3 ]
but it's to big big big array .. it's not a way to do this in a better method ?