View Full Version : EmitSoundToAll for clients?
Ibanezez
10-04-2014, 12:05
How can I do EmitSoundToAll only emitting the sound to the client? Would I do:
EmitSound(<insert sound here>, client)
or something else?
EDIT
Did a bit of research, this is what I found.
EmitSoundToClient does it to the client
Would I do "EmitSoundToClient(client, <name of sound>);" ?
LambdaLambda
10-04-2014, 12:10
Thats what you're looking for
https://sm.alliedmods.net/api/index.php?fastload=show&id=681&
https://wiki.alliedmods.net/CSGO_Quirks
thecount
10-04-2014, 13:53
Or ClientCommand(client, "playgamesound error.wav");
You'd do something like this:
PrecacheSound("some-folder/hellyeah.wav"); // in OnMapStart()
EmitSoundToClient(iClient, "some-folder/hellyeah.wav"); // where some-folder/hellyeah.wav is in the /sounds/ folder
Powerlord
10-04-2014, 16:05
Incidentally, the EmitSoundAny (https://forums.alliedmods.net/showthread.php?t=237045) include has stocks to abstract the logic needed to write cross-game plugins that need to emit sounds... you just have to remember to PrecacheSoundAny and EmitSoundAny/EmitSoundAllAny/EmitSoundToClientAny/EmitAmbientSoundAny instead of the normal commands.
Just be aware that CS:GO sometimes does weird things with volume levels and this only seems to work for MP3s (not WAVs).
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.