#define STANDARDTIMESTEPSOUND 400 
#include <amxmodx>
#include <fakemeta>
#include <biohazard>
#include <hamsandwich>

new bool:g_silent[33] 


fm_set_user_footsteps(index, set = 1) {         
	if (set) {                                
		set_pev(index, pev_flTimeStepSound, 999);                 
		g_silent[index] = true;
	}         
	else {                 
		set_pev(index, pev_flTimeStepSound, STANDARDTIMESTEPSOUND);                 
		g_silent[index] = false;
	}         
	return 1;
} 


public plugin_init() {         
	register_plugin("zm_nofs","1.0","bipbip")
	register_forward(FM_PlayerPreThink, "forward_player_prethink") 
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)

} 
	
public forward_player_prethink(index) {         
	if (g_silent[index])                 
		set_pev(index, pev_flTimeStepSound, 999); } 
		
		

public client_disconnect(index) {         
	g_silent[index] = false; }
	
	
public event_infect(id)
{
	fm_set_user_footsteps(id,1)
}

public fwHamPlayerSpawnPost(iPlayer) {
        if (is_user_alive(iPlayer)) {
                // player spawned
				fm_set_user_footsteps(iPlayer,0)
        }
}  