Raised This Month: $ Target: $400
 0% 

How I can make sound on the mapa?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 08:40   How I can make sound on the mapa?
Reply With Quote #1

Or how I can make ambient sound on the map, and remove it when that requirement? I have created ent, and want create ambient sound near this ent, AND remove this sound when destroy my ent or remove it. https://forums.alliedmods.net/showpo...61&postcount=4

Last edited by ZASTRELIS; 01-14-2014 at 09:32.
ZASTRELIS is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-14-2014 , 09:01   Re: How I can make sound on the mapa?
Reply With Quote #2

You can use emit sound
PHP Code:
emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 
__________________
What are you looking for here?

Last edited by DavidJr; 01-14-2014 at 09:03.
DavidJr is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 09:03   Re: How I can make sound on the mapa?
Reply With Quote #3

Quote:
Originally Posted by DavidJr View Post
You can use emit sound
PHP Code:
emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 
[B][I]tnx. read post[/I][/B]

Last edited by YamiKaitou; 01-14-2014 at 17:42.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 09:29   Re: How I can make sound on the mapa?
Reply With Quote #4

[B][I]oh sht. for example: I've used ent spawn..[/I][/B]
Code:
engfunc(EngFunc_SetModel, g_point_entuty, "models/somemodel.mdl")
[B][I]then I've used engfunc for EmitAmbientSound..[/I][/B]
Code:
engfunc(EngFunc_EmitAmbientSound, g_point_entuty, origin, "ambience/some.wav", 0.5, ATTN_IDLE, 0, random_num(140, 160))
[B][I]But trouble.. when I've removed ent from the world..[/I][/B]
Code:
engfunc(EngFunc_RemoveEntity, g_point_entuty)
[B][I]Sound doesn't removed. It's normal. But i need remove that!
And do it without "stopsound" client command![/I][/B]

Last edited by YamiKaitou; 01-14-2014 at 17:43.
ZASTRELIS is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-14-2014 , 09:42   Re: How I can make sound on the mapa?
Reply With Quote #5

Use SND_STOP
PHP Code:
emit_sound(entCHAN_STATIC"ambience/alien_beacon.wav"VOL_NORMATTN_NORMSND_STOPPITCH_NORM
__________________
What are you looking for here?
DavidJr is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 10:05   Re: How I can make sound on the mapa?
Reply With Quote #6

Quote:
Originally Posted by DavidJr View Post
Use SND_STOP
PHP Code:
emit_sound(entCHAN_STATIC"ambience/alien_beacon.wav"VOL_NORMATTN_NORMSND_STOPPITCH_NORM
[B][I]tnx +[/I][/B]

Quote:
Originally Posted by DavidJr View Post
You can use emit sound
PHP Code:
emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 
[B][I]now I understand you )[/I][/B]

Last edited by YamiKaitou; 01-14-2014 at 17:45.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 11:05   Re: How I can make sound on the mapa?
Reply With Quote #7

[B][I]little offtop: how I can stop sounds in winter environment via emit_sound?[/I][/B]

Code:
public logevent_BombPlanted(){     emit_sound(0, CHAN_AUTO, "radio/bombpl.wav", VOL_NORM, ATTN_NORM, SND_STOP, PITCH_NORM)     emit_sound(0, CHAN_AUTO, g_szBombSounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM); }
[B][I]this method didn't load? Because SND_STOP is too early?[/I][/B]

Last edited by YamiKaitou; 01-14-2014 at 17:45.
ZASTRELIS is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-14-2014 , 12:06   Re: How I can make sound on the mapa?
Reply With Quote #8

Ambience is entity, you must find all ambience entity and set the index of entity in emit_sound
__________________
What are you looking for here?
DavidJr is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2014 , 12:45   Re: How I can make sound on the mapa?
Reply With Quote #9

Quote:
Originally Posted by DavidJr View Post
Ambience is entity, you must find all ambience entity and set the index of entity in emit_sound
[B][I]No, sounds from bomb event isn't entities.
But in new round SND_STOP works correctly, and sound wich has been stopped isn't entity.[/I][/B]

Last edited by YamiKaitou; 01-14-2014 at 17:46.
ZASTRELIS is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-14-2014 , 17:29   Re: How I can make sound on the mapa?
Reply With Quote #10

I'm going to have some research and post the result
__________________
What are you looking for here?
DavidJr 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 10:07.


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