Raised This Month: $32 Target: $400
 8% 

Solved emit_sound help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 07-12-2022 , 04:26   emit_sound help
Reply With Quote #1

hi again. i want add sound effects on menu, when you have not access to item and select that it will play no access sound for that player, but when i put sound all players can hear it.

i use this code for sound

emit_sound(id, CHAN_STATIC, "ambience/noaccess.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

and 1 player plays it everyone hear that how can i make it only for that player?
or is there other code for it?
__________________
Hello!

Last edited by thebest24; 07-12-2022 at 04:58.
thebest24 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-12-2022 , 04:34   Re: emit_sound help
Reply With Quote #2

Use client_cmd(id, "spk ^"ambience/noaccess.wav^"");
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 07-12-2022 , 04:57   Re: emit_sound help
Reply With Quote #3

it worked
__________________
Hello!
thebest24 is offline
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 10-02-2022 , 06:39   Re: emit_sound help
Reply With Quote #4

also i wonder how can i disable emit or spk sound while its playing?
__________________
Hello!
thebest24 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 10-02-2022 , 15:13   Re: emit_sound help
Reply With Quote #5

Quote:
Originally Posted by thebest24 View Post
also i wonder how can i disable emit or spk sound while its playing?
You cant stop the sound of spk
for emit sound, you can emit a new sound with the same channel of your previous emit sound, that new emit sound it will be a null sound( a .wav of 1 seg and 0% of volume )
MrPickles is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-02-2022 , 18:22   Re: emit_sound help
Reply With Quote #6

Quote:
Originally Posted by MrPickles View Post
You cant stop the sound of spk
That's false, you can!

stopsound -> console command!
__________________

Last edited by deprale; 10-02-2022 at 18:22.
deprale is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 10-02-2022 , 18:29   Re: emit_sound help
Reply With Quote #7

Quote:
Originally Posted by deprale View Post
That's false, you can!

stopsound -> console command!
oo i didnt know it, thanks if that works
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-02-2022 , 22:13   Re: emit_sound help
Reply With Quote #8

Stopsound is a client command and I would consider this slowhacking because it affects way more than just the sound that you force the player to hear.
__________________
fysiks is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 10-02-2022 , 23:52   Re: emit_sound help
Reply With Quote #9

Well, slowhacking is a grey area depending on how you use it - but aside that, you are right it also stops map sounds as well (for example de_train airplane, or even the truck sounds in T spawn), also nades and etc.

I guess stopsound would only be useful in very specific cases.
__________________
deprale is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-04-2022 , 00:00   Re: emit_sound help
Reply With Quote #10

Quote:
Originally Posted by deprale View Post
Well, slowhacking is a grey area depending on how you use it.
Generally, I agree with that sentiment. If it were something that only affected what you're plugin was doing (or even other plugins) then I wouldn't have an issue.
__________________
fysiks 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 11:26.


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