AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replace footsteps sounds with other sounds (https://forums.alliedmods.net/showthread.php?t=172240)

tuty 11-17-2011 17:05

Replace footsteps sounds with other sounds
 
Hey, i tried this but doesnt work..
I want to replace default player footstep sounds with custom ones

PHP Code:



new const gDefaultStepSounds[ ][ ] =
{
    
"player/pl_dirt1.wav""player/pl_dirt2.wav""player/pl_dirt3.wav""player/pl_dirt4.wav",
    
"player/pl_duct1.wav""player/pl_duct2.wav""player/pl_duct3.wav""player/pl_duct4.wav",
    
"player/pl_grate1.wav""player/pl_grate2.wav""player/pl_grate3.wav""player/pl_grate4.wav",
    
"player/pl_metal1.wav""player/pl_metal2.wav""player/pl_metal3.wav""player/pl_metal4.wav",
    
"player/pl_slosh1.wav""player/pl_slosh2.wav""player/pl_slosh3.wav""player/pl_slosh4.wav",
    
"player/pl_snow1.wav""player/pl_snow2.wav""player/pl_snow3.wav""player/pl_snow4.wav"
    
"player/pl_snow5.wav""player/pl_snow6.wav""player/pl_step1.wav""player/pl_step2.wav"
    
"player/pl_step3.wav""player/pl_step4.wav""player/pl_tile1.wav""player/pl_tile2.wav",
    
"player/pl_tile3.wav""player/pl_tile4.wav""player/pl_tile5.wav"
};

public 
forward_EmitSound( const iEntity, const iChannel, const szSound[ ] )
{
    if( 
pev_validiEntity ) )
    {
        for( 
0sizeof gDefaultStepSoundsi++ )
        {
            if( 
equaliszSoundgDefaultStepSounds] ) != -)
            {
                
emit_soundiEntityiChannelgNewFootstepsrandom_num0charsmaxgNewFootsteps ) ) ], VOL_NORMATTN_NORM0PITCH_NORM );
        
                return 
FMRES_SUPERCEDE;    
            }
        }
    }
    
    return 
FMRES_IGNORED;



doesnt work

ConnorMcLeod 11-17-2011 17:58

Re: Replace footsteps sounds with other sounds
 
You have to hook PM_IDontRememberWhat with orpheu PM_PlaySound or PM_StepSound, block and replace with whatever the system you want.
Look at some anticheat from IDontRemeberWho, may be OT, this system is already used.

Sn!ff3r 11-17-2011 19:29

Re: Replace footsteps sounds with other sounds
 
Useful threads:

http://forums.alliedmods.net/showthr...light=footstep
http://forums.alliedmods.net/showthr...light=footstep
http://forums.alliedmods.net/showthr...light=footstep


All times are GMT -4. The time now is 08:25.

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