Raised This Month: $ Target: $400
 0% 

Variable structure explanation needed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DavidLin
Member
Join Date: Jan 2016
Old 01-08-2016 , 16:19   Variable structure explanation needed
Reply With Quote #1

Hello,

I was wondering what would be the structure of this variable(array) I am kind of new to pawn so every tip helps !

PHP Code:
enum _:ZOMBIE_CLASSES_SOUNDS {
        Array:
z_b_pain, Array:z_b_death,
        Array:
z_b_h_stab, Array:z_b_h_slash,
        Array:
z_b_m_wall, Array:z_b_m_slash
}
new Array:
soundsZOMBIE_CLASSES_SOUNDS ]; 
DavidLin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-08-2016 , 20:57   Re: Variable structure explanation needed
Reply With Quote #2

It's an array of dynamic array pointers (in such a way that you can index "sounds" with z_* names instead of numbers).
__________________

Last edited by fysiks; 01-08-2016 at 20:58.
fysiks is offline
DavidLin
Member
Join Date: Jan 2016
Old 01-09-2016 , 10:44   Re: Variable structure explanation needed
Reply With Quote #3

Thanks, another question. How can I make the array for every zombie class from a native:
PHP Code:
public native_register_zombie_soundsplugin_idparamaters_num ) {
        new 
class_idas get_param);

        new 
class_sound64 ]; new class_sound_type32 ];
        
get_string2class_soundcharsmaxclass_sound ) );
        
get_string3class_sound_typecharsmaxclass_sound_type ) );
        
precache_soundclass_sound );

        new 
class_names32 ];
        
ArrayGetStringnameclass_idasclass_namescharsmaxclass_names ) );
        
log_amx"Class: %s. Sound - %s / Type - %d",  class_namesclass_soundclass_sound_type );

        
soundsclass_id ][ class_sound_type ] = class_sound;


Code above sure is not to work because I don't know how to do it.

class file:
PHP Code:
Const:
new const 
sounds_miss[ ][ ] = { "umbrella_swarm/miss.wav""umbrella_swarm/miss2.wav" }

Precache:
    new 
index;
    for( 
index 0index sizeof sounds_painindex++ )
        
register_zombie_soundszombieClass_idsounds_painindex ], "z_b_pain" ); 
DavidLin is offline
Reply


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 09:25.


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