AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   EmitAmbientSound (https://forums.alliedmods.net/showthread.php?t=62479)

Mini_Midget 10-28-2007 00:47

EmitAmbientSound
 
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



ConnorMcLeod 10-28-2007 06:13

Re: EmitAmbientSound
 
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.

VEN 10-28-2007 09:13

Re: EmitAmbientSound
 
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) //

Mini_Midget 10-29-2007 03:05

Re: EmitAmbientSound
 
What are the floats for? What format does it play?
And does it loop the sample forever without doing set_tasks or such?

ConnorMcLeod 10-29-2007 07:09

Re: EmitAmbientSound
 
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.

VEN 10-29-2007 15:00

Re: EmitAmbientSound
 
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.


All times are GMT -4. The time now is 01:22.

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