as
jimaway said i think here is the problem..
your entity never think
PHP Code:
new ent = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "info_target" ) );
set_pev ( ent, pev_classname, item_name );
engfunc ( EngFunc_SetModel, ent, p_model );
->>
PHP Code:
new ent = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "info_target" ) );
set_pev ( ent, pev_classname, item_name );
engfunc ( EngFunc_SetModel, ent, p_model );
set_pev ( ent, pev_nextthink, get_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 ( ent, channel, const sound [ ] )
{
static classname [ 32 ];
pev(ent,pev_classname,classname,31);
if(equali(classname, item_name))
{
set_pev( ent, pev_nextthink, get_gametime( ) + 1.0 ); // your delay instead 1.0
if ( get_pcvar_num ( pCvar_sound ) )
{
new i = random ( sizeof ( d_sounds ) );
emit_sound ( ent, CHAN_VOICE, d_sounds [ i ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
__________________