Raised This Month: $ Target: $400
 0% 

Problem with Silencing Footsteps with FM


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 01-13-2009 , 23:22   Problem with Silencing Footsteps with FM
Reply With Quote #1

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;
}
Mlk27 is offline
 



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 01:45.


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