View Single Post
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 10-22-2014 , 08:02   Re: No sound emited by entity
Reply With Quote #3

as jimaway said i think here is the problem..
your entity never think

PHP Code:
new ent engfunc EngFunc_CreateNamedEntityengfunc EngFunc_AllocString"info_target" ) );
    
set_pev entpev_classnameitem_name );
    
engfunc EngFunc_SetModelentp_model ); 
->>

PHP Code:
new ent engfunc EngFunc_CreateNamedEntityengfunc EngFunc_AllocString"info_target" ) );
set_pev entpev_classnameitem_name );
engfunc EngFunc_SetModelentp_model ); 
set_pev entpev_nextthinkget_gametime( ) + 0.1 ); 
you need to make it instantly think after you create it.. and you'll set the new 'think delay' in the thinking forward.

-->
PHP Code:
public PmPSound entchannel, const sound [ ] )
{
    static 
classname 32 ];
    
pev(ent,pev_classname,classname,31);
    
    if(
equali(classnameitem_name))
    {
        
set_peventpev_nextthinkget_gametime( ) + 1.0 ); // your delay instead 1.0 
        
        
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;

__________________

My PC Themes . .

Last edited by red_bull2oo6; 10-22-2014 at 08:05.
red_bull2oo6 is offline