i dont know what is wrong. when players join they can't hear their footsteps when they are walking until they make a jump.
Code:
#include <amxmodx>
#include <fakemeta>
new bool:g_footstep_set[33] = false;
new g_MaxPlayers
public plugin_init()
{
register_clcmd("say /off_footsteps", "footsteps")
register_event("DeathMsg", "eDeathMsg", "a")
register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
register_forward(FM_PlayerPreThink, "fw_prethink")
g_MaxPlayers = get_maxplayers()
}
public client_putinserver(id)
{
g_footstep_set[id] = false;
fm_set_user_footsteps(id, false)
}
public client_disconnect(id)
{
g_footstep_set[id] = false;
fm_set_user_footsteps(id, false)
}
public eDeathMsg()
{
new id = read_data(2)
fm_set_user_footsteps(id, false)
}
public eNewRound()
{
for(new id; id <= g_MaxPlayers; id++)
{
g_footstep_set[id] = false;
fm_set_user_footsteps(id, false)
}
}
public fw_prethink(id)
{
if(g_footstep_set[id])
set_pev(id, pev_flTimeStepSound, 999);
}
public footsteps(id)
{
fm_set_user_footsteps(id, true)
client_print(id, print_chat, "Your footsteps are silenced.")
}
stock fm_set_user_footsteps(id, bool:set = true)
{
set_pev(id, pev_flTimeStepSound, set ? 999.0 : 400.0)
g_footstep_set[id] = set;
return 1;
}