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

Change footsteps sound, possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 09-07-2008 , 04:09   Change footsteps sound, possible?
Reply With Quote #1

Hi, short question:

how to change footstep sounds (if this is possible) ?
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-07-2008 , 04:18   Re: Change footsteps sound, possible?
Reply With Quote #2

No.But you can make block original sound, then make a fake ent and emit custom sound with a delay(time between steps).
Alka is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 09-07-2008 , 04:29   Re: Change footsteps sound, possible?
Reply With Quote #3

Quote:
No.But you can make block original sound, then make a fake ent and emit custom sound with a delay(time between steps).
Oh yeah :>

Maybe small example :] ?
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-07-2008 , 04:48   Re: Change footsteps sound, possible?
Reply With Quote #4

Code:
#include <amxmodx> #include <fakemeta>   #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Alka"   #define STEP_DELAY 0.5   new Float:g_fNextStep[33];   new const g_szStepSound[] = "custom_step_sound.wav";   public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR);    register_forward(FM_PlayerPreThink, "fwd_PlayerPreThink", 0); }   public plugin_precache()  precache_sound(g_szStepSound);   public fwd_PlayerPreThink(id) {  if(!is_user_alive(id))   return FMRES_IGNORED;    set_pev(id, pev_flTimeStepSound, 999);    if(g_fNextStep[id] < get_gametime())  {   if(fm_get_ent_speed(id) && (pev(id, pev_flags) & FL_ONGROUND))    emit_sound(id, CHAN_BODY, g_szStepSound, VOL_NORM, ATTN_STATIC, 0, PITCH_NORM);     g_fNextStep[id] = get_gametime() + STEP_DELAY;  }  return FMRES_IGNORED; }   stock Float:fm_get_ent_speed(id) {  if(!pev_valid(id))   return 0.0;    static Float:vVelocity[3];  pev(id, pev_velocity, vVelocity);    vVelocity[2] = 0.0;    return vector_length(vVelocity); }

Last edited by Alka; 09-07-2008 at 04:52.
Alka is offline
TSuNaMi_
BANNED
Join Date: Jan 2009
Location: After 2018 World
Old 05-28-2010 , 15:32   Re: Change footsteps sound, possible?
Reply With Quote #5

but there is 4 steps ??
TSuNaMi_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-28-2010 , 17:04   Re: Change footsteps sound, possible?
Reply With Quote #6

what 4 steps? This should block any footstep sounds.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
TSuNaMi_
BANNED
Join Date: Jan 2009
Location: After 2018 World
Old 05-28-2010 , 17:11   Re: Change footsteps sound, possible?
Reply With Quote #7

you look to into:

sound/players/ and you will see:

pl_step1.wav
pl_step2.wav
pl_step3.wav
pl_step4.wav
TSuNaMi_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-28-2010 , 17:13   Re: Change footsteps sound, possible?
Reply With Quote #8

Yest, they are played random...you can modify the array to 2D size, then put more custom sounds, and into emit_sound native, make it play a random step sound.

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define STEP_DELAY 0.5

new Float:g_fNextStep[33];

#define MAX_SOUNDS 4 //Max num of sound for list below

new const g_szStepSound[MAX_SOUNDS][] = {
    
    
"custom_step_sound#1.wav",
    
"custom_step_sound#2.wav",
    
"custom_step_sound#3.wav",
    
"custom_step_sound#4.wav"
};

public 
plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_PlayerPreThink"fwd_PlayerPreThink"0);
}

public 
plugin_precache()
{
    new 
i;
    for(
0MAX_SOUNDS i++)
        
precache_sound(g_szStepSound[i]);
}

public 
fwd_PlayerPreThink(id)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
set_pev(idpev_flTimeStepSound999);
    
    if(
g_fNextStep[id] < get_gametime())
    {
        if(
fm_get_ent_speed(id) && (pev(idpev_flags) & FL_ONGROUND))
            
emit_sound(idCHAN_BODYg_szStepSound[random(MAX_SOUNDS)], VOL_NORMATTN_STATIC0PITCH_NORM);
        
        
g_fNextStep[id] = get_gametime() + STEP_DELAY;
    }
    return 
FMRES_IGNORED;
}

stock Float:fm_get_ent_speed(id)
{
    if(!
pev_valid(id))
        return 
0.0;
    
    static 
Float:vVelocity[3];
    
pev(idpev_velocityvVelocity);
    
    
vVelocity[2] = 0.0;
    
    return 
vector_length(vVelocity);

__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-28-2010 at 18:31. Reason: Updated
Alka is offline
TSuNaMi_
BANNED
Join Date: Jan 2009
Location: After 2018 World
Old 05-28-2010 , 17:15   Re: Change footsteps sound, possible?
Reply With Quote #9

i did it but sounds coming to mix to players.
TSuNaMi_ is offline
TSuNaMi_
BANNED
Join Date: Jan 2009
Location: After 2018 World
Old 05-28-2010 , 17:22   Re: Change footsteps sound, possible?
Reply With Quote #10

oke thanks i will try now.
TSuNaMi_ is offline
Reply



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


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