Raised This Month: $51 Target: $400
 12% 

No sound emited by entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 10-22-2014 , 07:36   No sound emited by entity
Reply With Quote #1

Hi AM community, i have created an entity binded to a console comand and i want to add sounds to it when players are around , just it doesn't work and i don't know why, some help please

My code
PHP Code:
new const d_sounds [ ] [ ] =
{
    
"barnacle/bcl_alert2.wav",
    
"x/nih_die2.wav",
    
"x/x_pain1.wav",
    
"x/x_pain2.wav",
    
"x/x_pain3.wav"

and plugin_init
PHP Code:
register_forward FM_Think"PmPSound" ); 
now the forward
PHP Code:
public PmPSound entchannel, const sound [ ] )
{
    static 
classname 32 ];
    
pev(ent,pev_classname,classname,31);
    
    if(
equali(classnameitem_name))
    {
        if ( 
get_pcvar_num pCvar_sound ) )
        {
            new 
random sizeof d_sounds ) );
            
emit_sound entCHAN_VOICEd_sounds ], VOL_NORMATTN_NORM0PITCH_NORM );
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;

and created entity
PHP Code:
new ent engfunc EngFunc_CreateNamedEntityengfunc EngFunc_AllocString"info_target" ) );
    
set_pev entpev_classnameitem_name );
    
engfunc EngFunc_SetModelentp_model ); 
+ the global
PHP Code:
new const item_name [ ] = "dm_pumplin" 
what's wrong here ? because i hear no sound when i'm around entity.
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers

Last edited by CryWolf; 10-22-2014 at 07:42.
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
 



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 21:20.


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