Raised This Month: $ Target: $400
 0% 

Array Example [ Good? ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Baws
Veteran Member
Join Date: Oct 2012
Old 03-29-2014 , 11:45   Array Example [ Good? ]
Reply With Quote #1

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 );
__________________
Like my clean plugins and work?

Last edited by Baws; 03-29-2014 at 15:10.
Baws is offline
 



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:00.


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