AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How I can make sound on the mapa? (https://forums.alliedmods.net/showthread.php?t=233391)

ZASTRELIS 01-14-2014 08:40

How I can make sound on the mapa?
 
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

DavidJr 01-14-2014 09:01

Re: How I can make sound on the mapa?
 
You can use emit sound
PHP Code:

emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 


ZASTRELIS 01-14-2014 09:03

Re: How I can make sound on the mapa?
 
Quote:

Originally Posted by DavidJr (Post 2085744)
You can use emit sound
PHP Code:

emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 


:crab: [B][I]tnx. read post[/I][/B]

ZASTRELIS 01-14-2014 09:29

Re: How I can make sound on the mapa?
 
[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]

DavidJr 01-14-2014 09:42

Re: How I can make sound on the mapa?
 
Use SND_STOP
PHP Code:

emit_sound(entCHAN_STATIC"ambience/alien_beacon.wav"VOL_NORMATTN_NORMSND_STOPPITCH_NORM


ZASTRELIS 01-14-2014 10:05

Re: How I can make sound on the mapa?
 
Quote:

Originally Posted by DavidJr (Post 2085767)
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 (Post 2085744)
You can use emit sound
PHP Code:

emit_sound(indexchannel, const fileFloat:volumeFloat:attnflagspitch); 


[B][I]now I understand you )[/I][/B]

ZASTRELIS 01-14-2014 11:05

Re: How I can make sound on the mapa?
 
[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]

DavidJr 01-14-2014 12:06

Re: How I can make sound on the mapa?
 
Ambience is entity, you must find all ambience entity and set the index of entity in emit_sound

ZASTRELIS 01-14-2014 12:45

Re: How I can make sound on the mapa?
 
Quote:

Originally Posted by DavidJr (Post 2085831)
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]

DavidJr 01-14-2014 17:29

Re: How I can make sound on the mapa?
 
I'm going to have some research and post the result :)


All times are GMT -4. The time now is 10:07.

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