Raised This Month: $ Target: $400
 0% 

Array Example [ Good? ]


Post New Thread Reply   
 
Thread Tools Display Modes
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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-29-2014 , 13:19   Re: Array Example [ Good? ]
Reply With Quote #2

What is your question exactly?
__________________
Arkshine is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-29-2014 , 14:04   Re: Array Example [ Good? ]
Reply With Quote #3

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.
__________________
Like my clean plugins and work?
Baws is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-29-2014 , 14:09   Re: Array Example [ Good? ]
Reply With Quote #4

Just look at plugins that use dynamic arrays . . .
__________________
fysiks is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 03-29-2014 , 14:16   Re: Array Example [ Good? ]
Reply With Quote #5

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

Last edited by Baws; 03-29-2014 at 14:16.
Baws is offline
Reply



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