Raised This Month: $51 Target: $400
 12% 

Emit sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cstrike37
Member
Join Date: Jan 2012
Old 05-09-2013 , 18:39   Emit sound
Reply With Quote #1

Hi, sometimes sound wont play when another sound is being played. My question is: Is it possible to play multiple sound at the same time using emit or force it to play?

PHP Code:
public DeathMsg()
{
    new 
Victim read_data(2); //get the second message parameter

    
new origin[3];
    
pev(Victimpev_originorigin);
    
    new 
entity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
    
engfunc(EngFunc_SetOriginentityorigin);
    
set_pev(entitypev_classname"emitter");
    
    
emit_sound(entityCHAN_VOICE"misc/affn.wav"VOL_NORMATTN_NORM0PITCH_NORM);
    
    
set_task(5.0"kill_entity"entity+1337);

And

PHP Code:
public func_sounds(idchannel, const sound[], Float:volumeFloat:attnflagspitch)
{
    if(
equal(sound[7],"bhit",4))
    {
        
engfunc(EngFunc_EmitSound,id,channel,pain[random_num(0sizeof pain 1)],volume,attn,flags,pitch)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED


Last edited by cstrike37; 05-09-2013 at 18:41.
cstrike37 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 04:55   Re: Emit sound
Reply With Quote #2

try different channels
__________________
Blizzard_87 is offline
cstrike37
Member
Join Date: Jan 2012
Old 05-10-2013 , 12:58   Re: Emit sound
Reply With Quote #3

Okay thanks.
But what's the difference between these channels?

PHP Code:
Sound Constants:
//Sound Channels
#define CHAN_AUTO     0
#define CHAN_WEAPON     1
#define CHAN_VOICE     2
#define CHAN_ITEM     3
#define CHAN_BODY     4
#define CHAN_STREAM     5
#define CHAN_STATIC     6
#define CHAN_NETWORKVOICE_BASE    7
#define CHAN_NETWORKVOICE_END    500 
cstrike37 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 17:42   Re: Emit sound
Reply With Quote #4

try the auto one. Or you could just use
client_ cmd( 0, "spk soundhere" );

then if sound long just do client_cmd( 0, "stopsound" ); when you want to stop all sounds
__________________
Blizzard_87 is offline
cstrike37
Member
Join Date: Jan 2012
Old 05-10-2013 , 18:54   Re: Emit sound
Reply With Quote #5

I'll try thanks!
And is it possible to change the sound radius using client_cmd?

Last edited by cstrike37; 05-10-2013 at 18:55.
cstrike37 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 19:03   Re: Emit sound
Reply With Quote #6

Quote:
Originally Posted by cstrike37 View Post
I'll try thanks!
And is it possible to change the sound radius using client_cmd?
no you can only set sound radius in emit_sound so for sounds you dont need to have a limit on radius just use client_cmd( 0, "spk.......
__________________
Blizzard_87 is offline
cstrike37
Member
Join Date: Jan 2012
Old 05-10-2013 , 19:49   Re: Emit sound
Reply With Quote #7

Quote:
Originally Posted by Blizzard_87 View Post
no you can only set sound radius in emit_sound so for sounds you dont need to have a limit on radius just use client_cmd( 0, "spk.......
Oh
What if I use Ham_Killed? or is it the same as Deathmsg?
cstrike37 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 20:40   Re: Emit sound
Reply With Quote #8

test both. see which works?
__________________
Blizzard_87 is offline
cstrike37
Member
Join Date: Jan 2012
Old 05-10-2013 , 20:45   Re: Emit sound
Reply With Quote #9

I just used DeathMsg cause it works better

I have another question, how do I make this play 4 random sound instead of just 1?
PHP Code:
engfunc(EngFunc_EmitSoundidchannel"test/test1.wav"1.0attenuationflagspitch); 
I tried doing this

PHP Code:
engfunc(EngFunc_EmitSoundidchanneldie_spk[random_num(0sizeof die_spk 1)], 1.00.92flagspitch); 
But it's not working, it's only playing 1 sound

Last edited by cstrike37; 05-10-2013 at 20:49.
cstrike37 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 20:50   Re: Emit sound
Reply With Quote #10

its spose to only play one. It plays one by random.
__________________
Blizzard_87 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 02:50.


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