Raised This Month: $ Target: $400
 0% 

Solved Play Sound Only Player Can Hear


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 04-16-2016 , 05:42   Play Sound Only Player Can Hear
Reply With Quote #1

hey guys. can you emit sound that only a targeted player can hear?...

Last edited by hellmonja; 06-25-2017 at 04:25. Reason: Solved...
hellmonja is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-16-2016 , 06:00   Re: [HELP] Play Sound Only Player Can Hear
Reply With Quote #2

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?
__________________

Last edited by Black Rose; 04-16-2016 at 06:01.
Black Rose is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-16-2016 , 11:22   Re: [HELP] Play Sound Only Player Can Hear
Reply With Quote #3

Yes, he asked clearly "emit_sound". I personally think it's not possible.
siriusmd99 is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 04-16-2016 , 13:09   Re: [HELP] Play Sound Only Player Can Hear
Reply With Quote #4

Quote:
Originally Posted by Black Rose View Post
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?...
hellmonja is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-17-2016 , 13:02   Re: [HELP] Play Sound Only Player Can Hear
Reply With Quote #5

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.
__________________

Last edited by Black Rose; 04-17-2016 at 13:02.
Black Rose 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 18:43.


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