I'm emitting sounds to players but they're either not being emitted or glitch the audio.
I have 4 sounds:
#1, doesn't emit.
PHP Code:
public @HamSpawn_Post( id )
{
if( is_user_alive( id ) )
{
client_cmd( id, "spk %s", g_iSounds[ Landing_Sound ] );
}
return HAM_IGNORED;
}
#2, Glitches the audio, makes a weird un-pleasant noise.
PHP Code:
public @HamThinkInfoTarget_Pre( iEnt )
{
if( ! pev_valid( iEnt ) )
return HAM_IGNORED;
new szClassName[ 32 ];
pev( iEnt, pev_classname, szClassName, charsmax( szClassName ) );
if( equal( szClassName, AIRDROP_CLASSNAME ) )
{
set_pev( iEnt, pev_nextthink, get_gametime( ) + 0.01 );
if( pev( iEnt, pev_flags ) & FL_ONGROUND )
{
client_cmd( 0, "spk %s", g_iSounds[ AirDrop_Land_Sound ] );
}
}
return HAM_IGNORED;
}
#3, doesn't emit
PHP Code:
public @HamThinkPlayer_Pre( id )
{
if( ! is_user_alive( id ) )
return HAM_IGNORED;
if( g_bIsPlayerInParachute[ id ] )
{
static Float:fVelocity[ 3 ];
pev( id, pev_velocity, fVelocity );
if( pev( id, pev_flags ) & FL_ONGROUND )
{
g_bIsPlayerInParachute[ id ] = false;
client_cmd( id, "spk %s", g_iSounds[ Landing_Sound ] );
}
}
return HAM_IGNORED;
}
#4, Works properly
PHP Code:
MakeAirDropEnt( )
{
client_cmd( 0, "spk %s", g_iSounds[ AirDrop_Appear_Sound ] );
}
They're all 8 bit 22050 hz mono channel
__________________