Raised This Month: $ Target: $400
 0% 

[CSGO] Get sound path in Player_footstep event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killerbigpoint
Junior Member
Join Date: Sep 2015
Old 05-13-2017 , 16:27   [CSGO] Get sound path in Player_footstep event
Reply With Quote #1

Hello, how do it get the name of the footstep sound? because i need to stop the original sound and emit it again

the name in the function only reports "player_footstep"

Code:
public Action:Event_FootStep(Handle:event, const String:name[], bool:dontBroadcast)
{
	PrintToServer("name of footstep path: %s", name);
}

Last edited by killerbigpoint; 05-13-2017 at 16:29.
killerbigpoint is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 05-13-2017 , 16:47   Re: [CSGO] Get sound path in Player_footstep event
Reply With Quote #2

Just use sv_footsteps 0, then you dont need to worry about blocking it and can just emit it yourself.

Or do you need to only need to block it for certain players? Then use a Soundhook: https://forums.alliedmods.net/showpo...5&postcount=11

Last edited by Kinsi; 05-13-2017 at 16:49.
Kinsi is offline
killerbigpoint
Junior Member
Join Date: Sep 2015
Old 05-13-2017 , 16:50   Re: [CSGO] Get sound path in Player_footstep event
Reply With Quote #3

Sure i'll put that command on, but i need to emit the same footstep sound from a my plugin, the problem is how do i get the path to the exact same sound?
killerbigpoint is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 05-13-2017 , 16:55   Re: [CSGO] Get sound path in Player_footstep event
Reply With Quote #4

You can use snd_show_print 1 in your CSGO which will print any played sound to the console.

Keep in mind that theres different footstep sounds for different surface types, so using the soundhook method might be better for your setup. Check out the thread i linked, theres a couple examples for that there.

Last edited by Kinsi; 05-13-2017 at 16:55.
Kinsi is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 05-13-2017 , 17:11   Re: [CSGO] Get sound path in Player_footstep event
Reply With Quote #5

Use
PHP Code:
AddNormalSoundHook 
ESK0 is offline
killerbigpoint
Junior Member
Join Date: Sep 2015
Old 05-13-2017 , 21:09   Re: [CSGO] Get sound path in Player_footstep event
Reply With Quote #6

Okay so my new code looks like this, but it won't emit a sound and i really don't know why, do you guys know why?

This is fired everytime a footstep sound is made which comes from AddNormalSoundHook
Quote:
new client = GetClientOfUserId(entity);
new Float:position[3];
GetEntPropVector(client, Prop_Send, "m_vecOrigin", position);

decl newClients[MaxClients];
new bool:newTotal;

for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && !IsFakeClient(i))
{
newClients[newTotal++] = i;
}
}

PrecacheSound("player/footsteps/wade1.wav");

EmitSound(newClients, newTotal, "player/footsteps/wade1.wav", SOUND_FROM_WORLD, channel, level, flags, volume, pitch, _, position);

Last edited by killerbigpoint; 05-13-2017 at 21:11.
killerbigpoint 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 05:47.


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