Raised This Month: $51 Target: $400
 12% 

[CS:GO] Mute player footsteps - help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szyma94
Member
Join Date: Nov 2014
Location: Poland
Old 03-19-2015 , 11:48   [CS:GO] Mute player footsteps - help
Reply With Quote #1

Hi I used this code it work, but player all time crouch, how fix it?
Code:
public OnPluginStart()
{
	HookEvent("player_footstep", event_FootStep);
}

public event_FootStep(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(active[client])
	{
		if(IsClientInGame(client) && IsPlayerAlive(client))
		{
			SetEntProp(client, Prop_Data, "m_fFlags", 4);
		}
	}
	
}
so it looks
http://youtu.be/V4cILiVlEQg

Last edited by szyma94; 03-19-2015 at 12:28. Reason: add yt video
szyma94 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 03-19-2015 , 13:14   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #2

Wouldn't it be easier to just add a SoundHook and cancel out the .wavs for the footsteps?
__________________
DeathChaos25 is offline
szyma94
Member
Join Date: Nov 2014
Location: Poland
Old 03-19-2015 , 13:32   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #3

how to do?
szyma94 is offline
szyma94
Member
Join Date: Nov 2014
Location: Poland
Old 03-20-2015 , 12:30   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #4

Ok i used this code it work, but how to make this only for active[client]
Code:
#include <sourcemod>
#include <sdktools>

new bool:active[MAXPLAYERS+1];
new Handle:TFootstepsEnabledConVar;

public OnPluginStart()
{
	AddNormalSoundHook(Event_SoundPlayed);
}

public OnClientPutInServer(client)
{
	SendConVarValue(client, FindConVar("sv_footsteps"), "0");
}

public OnItemEnabled(id)
{
	active[id] = true;
}

public OnItemDisabled(id)
{
	active[id] = false;
}

public Action:Event_SoundPlayed(clients[64],&numClients,String:sample[PLATFORM_MAX_PATH],&entity,&channel,&Float:volume,&level,&pitch,&flags) 
{
	if (entity 
		&& entity <= MaxClients 
		&& (StrContains(sample, "physics") != -1 || StrContains(sample, "footsteps") != -1))
	{
		if (IsClientInGame(entity) 
			&& !GetConVarBool(TFootstepsEnabledConVar))
		{
			return Plugin_Handled
		}
		else
		{
			EmitSoundToAll(sample, entity);
			return Plugin_Handled
		}
	}

	return Plugin_Continue
}
szyma94 is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-20-2015 , 13:18   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #5

AHA EASY

Spoiler
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-20-2015 , 13:23   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #6

sending sv_footsteps 0 to a client will disable all footsteps that the client hears.
Mitchell is offline
michaelrw
Senior Member
Join Date: Jul 2017
Old 12-16-2017 , 23:12   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
sending sv_footsteps 0 to a client will disable all footsteps that the client hears.
im trying to disable both the footsteps and the jump sounds that come from other clients, without disabling them for me. I tried something like

Spoiler

and it disables all other client footsteps, and my own. so i need to
1) find how to leave player footsteps enabled
2) disable jump sounds from all clients, except for player

im thinking #2 might require some SoundHook function ... but im not certain on how this would be done
__________________

michaelrw is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-17-2017 , 03:20   Re: [CS:GO] Mute player footsteps - help
Reply With Quote #8

pretty sure this has been asked in another thread and was solved as I use it in a few of my custom gamemodes for csgo. if you send sv_footsteps 0 to the clients, while keeping it 1 on the server you can reemit the sounds you want with the sound hook. This is the best way as it blocks the clientside sounds also.
Mitchell is offline
Reply



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 19:57.


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