Raised This Month: $ Target: $400
 0% 

Cache values for custom ents


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-26-2013 , 14:40   Cache values for custom ents
Reply With Quote #1

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_fVelocityENTS_ARRAY_SIZE ][ ]

public 
CreateEnts()
{
    new 
iEnt create_entity"info_target" )
    
peviEntpev_velocityg_fVelocityiEnt ] ) // index out of bounds
}

public 
EntsThinkiEnt )
{
    if( 
is_valid_entiEnt ) )
    {
        
PrintVelocityiEnt )
        
        
// set next think .. others
    
}
}

PrintVelocityiEnt )
{
    
server_print"print: %f %f %f"g_fVelocityiEnt ][ ], g_fVelocityiEnt ][ ], g_fVelocityiEnt ][ ] )

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_fVelocityMAX_ENTS ][ 
but it's to big big big array .. it's not a way to do this in a better method ?

Last edited by dFF; 07-26-2013 at 14:49.
dFF is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode