Raised This Month: $32 Target: $400
 8% 

Solved [ H3LP ] 3d dynamic array


Post New Thread Reply   
 
Thread Tools Display Modes
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-27-2018 , 12:33   Re: [ H3LP ] 3d dynamic array
Reply With Quote #11

I don't know if this is right, but I just removed the eKnifeSounds from g_szKnifeSounds and now it's working.

Code:
new const g_szKnivesSounds[][][]
__________________








CrazY. is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-27-2018 , 12:39   Re: [ H3LP ] 3d dynamic array
Reply With Quote #12

I don't think if that was the issue.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-27-2018 , 17:44   Re: [ H3LP ] 3d dynamic array
Reply With Quote #13

You're right, it is a 3-dimension array. I didn't notice that g_szKnivesSounds had two groups of strings.

I was able to fix your issue by specifying a size of 2 in the first dimension; I created enumerator eKnifeGroups for this purpose. I'm not sure why it's not working without it.
PHP Code:
#include <amxmodx>

enum eKnifeGroups
{
    
KG_BOXING,
    
KG_EXAMPLE
}

enum eKnifeSounds
{
    
SND_KNIFE_DEPLOY 0,
    
SND_KNIFE_DEPLOY1,
    
SND_KNIFE_HIT1,
    
SND_KNIFE_HIT2,
    
SND_KNIFE_HIT3,
    
SND_KNIFE_HIT4,
    
SND_KNIFE_WALL1,
    
SND_KNIFE_WALL2,
    
SND_KNIFE_SLASH1,
    
SND_KNIFE_SLASH2,
    
SND_KNIFE_STAB
};

new const 
g_szKnivesSoundseKnifeGroups ][ eKnifeSounds ][] = 
{
    { 
        
"boxing_deploy1"
        
"boxing_deploy1"
        
"boxing_hit1"
        
"boxing_hit2"
        
"boxing_hit3"
        
"boxing_hit4"
        
"boxing_hitwall1"
        
"boxing_hitwall1"
        
"boxing_slash1"
        
"boxing_slash2"
        
"boxing_stab" 
    
},
    {
        
"example_deploy1"
        
"example_deploy1"
        
"example_hit1"
        
"example_hit2"
        
"example_hit3"
        
"example_hit4"
        
"example_hitwall1"
        
"example_hitwall1"
        
"example_slash1"
        
"example_slash2"
        
"example_stab" 
    
}
}

public 
plugin_init() 
{
    new 
szSound64 ]
    
    for ( new 
eKnifeGroups:iKG KG_BOXING iKG eKnifeGroups iKG++ )
    {
        for ( new 
eKnifeSounds:iKS SND_KNIFE_DEPLOY iKS eKnifeSounds iKS++ )
        {
            
formatex(szSoundcharsmax(szSound), "weapons/%s.wav"g_szKnivesSounds[iKG][iKS] );
            
server_print("g_szKnivesSounds[%d][%d] = %s"iKGiKSszSound);
            
//precache_sound(szSound);
        
}
    }

Code:
g_szKnivesSounds[0][0] = weapons/boxing_deploy1.wav
g_szKnivesSounds[0][1] = weapons/boxing_deploy1.wav
g_szKnivesSounds[0][2] = weapons/boxing_hit1.wav
g_szKnivesSounds[0][3] = weapons/boxing_hit2.wav
g_szKnivesSounds[0][4] = weapons/boxing_hit3.wav
g_szKnivesSounds[0][5] = weapons/boxing_hit4.wav
g_szKnivesSounds[0][6] = weapons/boxing_hitwall1.wav
g_szKnivesSounds[0][7] = weapons/boxing_hitwall1.wav
g_szKnivesSounds[0][8] = weapons/boxing_slash1.wav
g_szKnivesSounds[0][9] = weapons/boxing_slash2.wav
g_szKnivesSounds[0][10] = weapons/boxing_stab.wav
g_szKnivesSounds[1][0] = weapons/example_deploy1.wav
g_szKnivesSounds[1][1] = weapons/example_deploy1.wav
g_szKnivesSounds[1][2] = weapons/example_hit1.wav
g_szKnivesSounds[1][3] = weapons/example_hit2.wav
g_szKnivesSounds[1][4] = weapons/example_hit3.wav
g_szKnivesSounds[1][5] = weapons/example_hit4.wav
g_szKnivesSounds[1][6] = weapons/example_hitwall1.wav
g_szKnivesSounds[1][7] = weapons/example_hitwall1.wav
g_szKnivesSounds[1][8] = weapons/example_slash1.wav
g_szKnivesSounds[1][9] = weapons/example_slash2.wav
g_szKnivesSounds[1][10] = weapons/example_stab.wav
__________________

Last edited by Bugsy; 06-27-2018 at 17:46.
Bugsy is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-27-2018 , 20:40   Re: [ H3LP ] 3d dynamic array
Reply With Quote #14

Thanks @Bugsy, it's working fine.
__________________








CrazY. is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 06-28-2018 , 02:59   Re: [ H3LP ] 3d dynamic array
Reply With Quote #15

can i know which type of plugin is this
__________________
SED LYF !!!
SHIELD755 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-28-2018 , 08:50   Re: [ H3LP ] 3d dynamic array
Reply With Quote #16

It's a knives shop sytem for Jailbreak.
__________________








CrazY. is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 06-28-2018 , 09:13   Re: [ H3LP ] 3d dynamic array
Reply With Quote #17

I think its better to add weapons/ string to that sounds and don't use formatex in Emit Sound function. This will use extra memory but increase performance.
Also u can save 5 CPU Cycles (or more cause u call native too) with changing this code:

Code:
if (!equali(szSample[8], "knife_", 6))
        return FMRES_IGNORED;
To this:

Code:
if (!szSample[8] != 'k')
        return FMRES_IGNORED;
[Cause there's only knife that starts with k character in weapons folder]
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 06-28-2018 at 09:16.
Ghosted 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 15:01.


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