What i understood about arrays is that you create them and destroy them.
Whenever you will use them you will have to push them at the end. Am i right?
You create them, push them wherever you use them, destroy them. Right?
Here is just example what i did:
Code:
#include < amxmodx >
#include < amxmisc >
#define PLUGIN "Array Example"
#define VERSION "1.0"
#define AUTHOR "Baws"
enum _Enums
{
Something[ 128 ],
Something1[ 128 ]
}
new g_DynamicArray[ _Enums ];
new Array:g_hTestArray
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR )
register_clcmd( "say /test", "cmdArrayTest" )
g_hTestArray = ArrayCreate( sizeof( g_DynamicArray ) );
}
public cmdArrayTest( id )
{
if( !g_DynamicArray[ Something ][ 0 ] || !g_DynamicArray[ Something1 ][ 0 ] )
client_print( id, print_chat, "The arrays are here *_* wow" )
else
client_print( id, print_chat, "No arrays for you!" )
ArrayPushArray( g_hTestArray, g_DynamicArray )
}
public plugin_end( )
ArrayDestroy( g_hTestArray );
__________________