AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Array Example [ Good? ] (https://forums.alliedmods.net/showthread.php?t=237782)

Baws 03-29-2014 11:45

Array Example [ Good? ]
 
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? :3

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 );

Arkshine 03-29-2014 13:19

Re: Array Example [ Good? ]
 
What is your question exactly?

Baws 03-29-2014 14:04

Re: Array Example [ Good? ]
 
Not a question. Just a comment on like if the example i gave is right.

As i searched on arrays and studied them, what i understood i typed it up there.
I want to know if what i understood is good or not.

fysiks 03-29-2014 14:09

Re: Array Example [ Good? ]
 
Just look at plugins that use dynamic arrays . . .

Baws 03-29-2014 14:16

Re: Array Example [ Good? ]
 
I looked just wanted to be sure... that's why scripting help forums is there duh.
( Tested the code and it works so i think i'm good )

Thanks anyways lol


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

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