register_forward(FM_PlayerPreThink, "fwd_PlayerPreThink", 0);
new const g_szStepSound[MAX_SOUNDS][] = {
"player/jb/pl_step1.wav",
"player/jb/pl_step2.wav",
"player/jb/pl_step3.wav",
"player/jb/pl_step4.wav"
};
public fwd_PlayerPreThink(id)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
set_pev(id, pev_flTimeStepSound, 99999);
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[random(MAX_SOUNDS)], 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);
}
On HLDS - that's the only way it will beI make this plugin, but he removes all walking sounds. What should I do to add the sounds of walking up a ladder, swimming?
Orpheyushka's hooks are already installed in RegameDLLWill it be possible through Orpheu?
Orpheyushka's
я уже дал подсказкуCan you give me a hint more?
if I understood correctly it isn't possible to exchange water/ladder sounds from Hlds. It is needed for this Orpheu.
я уже дал подсказку
единственное что flTimeStepsound засылать надо в clientdata, иначе на стороне движка оригинальный код шагов работать не будет
Is this a part of the code from reapi library?Вода - var_waterlevel
Лестница - MOVETYPE_FLY
Can I intercept it, or are the steps on metal, sand, snow?Kiperek,
Oh, ladder and swimming
Код:OrpheuRegisterHook(OrpheuGetFunction("PM_LadderMove") OrpheuRegisterHook(OrpheuGetFunction("PM_WaterMove")
Yes u need use - EngFunc_TraceTexture + DLLFunc_PM_FindTextureTypeCan I intercept it, or are the steps on metal, sand, snow?