Raised This Month: $ Target: $400
 0% 

Problem with Silencing Footsteps with FM


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-14-2009 , 01:18   Re: Problem with Silencing Footsteps with FM
Reply With Quote #7

I think you're wrong here :

Code:
public FM_PlayerPreThink(id) 
{
    if(g_footstep_set[id])
        set_pev(id, pev_flTimeStepSound, 999);
}
Should be 999.0 or 999.9 whatever but a float.

I would do :

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define MAX_PLAYERS    32

new bool:g_bNoFootSteps[MAX_PLAYERS+1]
new 
bool:g_bAlive[MAX_PLAYERS+1]

public 
plugin_init()
{
    
RegisterHam(Ham_Spawn"player""Player_Spawn"1)
    
RegisterHam(Ham_Killed"player""Player_Killed"1)
    
RegisterHam(Ham_Player_PreThink"player""Player_PreThink")

    
register_clcmd("say /footsteps""Cmd_FootSteps")
}

public 
client_putinserver(id)
{
    
g_bNoFootSteps[id] = false
}

public 
Player_Spawn(id)
{
    
g_bAlive[id] = bool:is_user_alive[id]
    
//g_bNoFootSteps[id] = false
}

public 
Player_Killed(id)
{
    
g_bAlive[id] = bool:is_user_alive[id]
}

public 
Player_PreThink(id
{
    if(
g_bAlive[id] && g_bNoFootSteps[id])
        
set_pev(idpev_flTimeStepSound999.0)
}

public 
Cmd_FootSteps(id)
{
    
g_bNoFootSteps[id] = !g_bNoFootSteps[id]
    
client_print(idprint_chat"Your footsteps are %ssilenced."g_bNoFootSteps[id] ? "" "not ")

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-14-2009 at 01:28.
ConnorMcLeod 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