AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Variable structure explanation needed (https://forums.alliedmods.net/showthread.php?t=277410)

DavidLin 01-08-2016 16:19

Variable structure explanation needed
 
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 ]; 


fysiks 01-08-2016 20:57

Re: Variable structure explanation needed
 
It's an array of dynamic array pointers (in such a way that you can index "sounds" with z_* names instead of numbers).

DavidLin 01-09-2016 10:44

Re: Variable structure explanation needed
 
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" ); 



All times are GMT -4. The time now is 09:25.

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