Hum, i've maded something...maybe is not the best way but shold work
Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Custom FootSteps Sound"
#define VERSION "1.0"
#define AUTHOR "Alka"
new Float:NextCheck[33];
new const FootStepSound[] = "misc/whatever.wav";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_PlayerPostThink, "Fwd_PlayerPostThink");
}
public Fwd_PlayerPostThink(id)
{
if(!is_user_alive(id))
return;
static Float:gametime;
gametime = get_gametime();
if(NextCheck[id] < gametime)
{
static Float:Velocity[3], Button;
pev(id, pev_velocity, Velocity);
pev(id, pev_button, Button);
if((Button & IN_FORWARD) || (Button & IN_BACK) || (Button & IN_LEFT) || (Button & IN_RIGHT))
{
if(pev(id, pev_flFallVelocity) == 0.0 && floatround(vector_length(Velocity)) != 0.0)
{
emit_sound(id, CHAN_VOICE, FootStepSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}
}
NextCheck[id] = gametime + 3.0;
}
}
Is for a sound with 3 sec len. ;)
__________________