AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Play Sound Only Player Can Hear (https://forums.alliedmods.net/showthread.php?t=281630)

hellmonja 04-16-2016 05:42

Play Sound Only Player Can Hear
 
hey guys. can you emit sound that only a targeted player can hear?...

Black Rose 04-16-2016 06:00

Re: [HELP] Play Sound Only Player Can Hear
 
Code:
client_cmd(id, "spk ^"%s^"", filename_variable); // .wav client_cmd(id, "mp3 play ^"%s^"", filename_variable); // .mp3

Or do you mean an ambient sound that changes volume depending on how close you are, for one player only?

siriusmd99 04-16-2016 11:22

Re: [HELP] Play Sound Only Player Can Hear
 
Yes, he asked clearly "emit_sound". I personally think it's not possible.

hellmonja 04-16-2016 13:09

Re: [HELP] Play Sound Only Player Can Hear
 
Quote:

Originally Posted by Black Rose (Post 2411520)
Code:
client_cmd(id, "spk ^"%s^"", filename_variable); // .wav client_cmd(id, "mp3 play ^"%s^"", filename_variable); // .mp3

Or do you mean an ambient sound that changes volume depending on how close you are, for one player only?

hey this is exactly what i needed, thanks! i didn't know you can use client_cmd like that. all i know with regards to sound is emit sound.

while we're in the subject of client_cmds, is it possible to force bots to use a custom client_cmd? like for example I added an extra weapon in my game and it has a client_cmd for you to obtain it. is it possible to make a bot use it as well to get the extra weapon?...

Black Rose 04-17-2016 13:02

Re: [HELP] Play Sound Only Player Can Hear
 
I assume so. I'm not sure. Please try.
Otherwise you could always call the function that gives the player this weapon from another plugin using
callfunc_begin()
callfunc_push_*()
callfunc_end()

or by using CreateOneForward() and ExecuteForward().

I'm not so sure about using the weapon though. That might be more complicated. Depending on how the bot is constructed.


All times are GMT -4. The time now is 18:43.

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