Raised This Month: $ Target: $400
 0% 

EmitAmbientSound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 10-28-2007 , 00:47   EmitAmbientSound
Reply With Quote #1

What is this for and how would I use it?
http://www.amxmodx.org/funcwiki.php?...ound&go=search
It sounds like it plays a background music or some sort...
I wouldn't mind using it if it does so I don't have to this...

PHP Code:
public ambience_loop() 
{
    if(!
get_pcvar_num(zomb_switch) || !get_pcvar_num(zomb_ambience))
        return 
PLUGIN_HANDLED
    
    client_cmd
(0,"spk %s"ZOMBIE_AMBIENCE)
    
    
set_task(17.0,"ambience_loop")
    
    return 
PLUGIN_CONTINUE

__________________
It's a mystery.
Mini_Midget is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-28-2007 , 06:13   Re: EmitAmbientSound
Reply With Quote #2

I guess that in your case, it would be better to edit your sound with a log and add a tag to make it play in loop, and still use spk command.
I don't even lnow how to do that, simon logic told a bit about it in his loading song plugin thread.
ConnorMcLeod is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-28-2007 , 09:13   Re: EmitAmbientSound
Reply With Quote #3

Syntax:
Code:
EngFunc_EmitAmbientSound,   // void )   (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); //
Usage example:
Code:
engfunc(EngFunc_EmitAmbientSound, 0 /* worldspawn */, Float:{45.6, 234.8, 129.2}, "items/ammopickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) //

Last edited by VEN; 10-29-2007 at 15:03.
VEN is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 10-29-2007 , 03:05   Re: EmitAmbientSound
Reply With Quote #4

What are the floats for? What format does it play?
And does it loop the sample forever without doing set_tasks or such?
__________________
It's a mystery.
Mini_Midget is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-29-2007 , 07:09   Re: EmitAmbientSound
Reply With Quote #5

Ven has forgotten the soundfile :

Code:
engfunc(EngFunc_EmitAmbientSound, 0, origin, sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

If you want the sound to be heard in the whole map, set the attenuation to ATTN_NONE, but in that case, spk command will do the same except the sound won't be located.
You still need to make a task if the sound doesn't loop by himself as i wrote in my first post.

Last edited by ConnorMcLeod; 10-29-2007 at 07:12.
ConnorMcLeod is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-29-2007 , 15:00   Re: EmitAmbientSound
Reply With Quote #6

Quote:
What are the floats for?
It's an origin of the sound source.

Quote:
What format does it play?
*.wav

Quote:
And does it loop the sample forever without doing set_tasks or such?
No.

Quote:
Ven has forgotten the soundfile
Thanks, fixed.

Last edited by VEN; 10-29-2007 at 15:04.
VEN 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 01:22.


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