Raised This Month: $ Target: $400
 0% 

Ambience Sound + Loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 06-02-2011 , 12:18   Re: Ambience Sound + Loop
Reply With Quote #1

Update: I tried the plugin below, and it worked, for a second. Once I joined a team it turned off... so I tried reconnecting and it doesnt even play when i enter the server again. Any help?

This is the code I used.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

new gSound[] = "test1.wav"

public plugin_init()
{
    
register_plugin("Emit Sound""1.0""Jelle")
    
    
set_task(96.0"emitSound"_"b")
}

public 
plugin_precache()
{
    
precache_sound(gSound)
}

public 
emitSound()
{
    
emit_sound(0CHAN_AUTOgSoundVOL_NORMATTN_NORM0PITCH_NORM)


This time I finally did download the sound file which was an improvement. I disabled all over plugins as well. I cant figure out why it stopped playing once I joined a team.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 06-02-2011 , 12:29   Re: Ambience Sound + Loop
Reply With Quote #2

when playing a wav and making all players hear it is this.

client_cmd(0"spk %s", gSound)

if mutiple sounds in one variable is this.

client_cmd(0,"spk ^"%s^"",gSound)
__________________
jc980 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2011 , 13:32   Re: Ambience Sound + Loop
Reply With Quote #3

Try changing this:
PHP Code:
set_task(96.0"emitSound"_"b"
To this:
PHP Code:
set_task(96.0"emitSound"_, .flags "b"
</span></span>
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-04-2011 , 11:46   Re: Ambience Sound + Loop
Reply With Quote #4

Well ofc it doesn't work if you reconnect, but you must wait at least 96 seconds... guess why.

@drekes, that's the exact same thing, you could use .flags if you want to specify it as 3rd param.
__________________
Hunter-Digital is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-04-2011 , 13:42   Re: Ambience Sound + Loop
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
@drekes, that's the exact same thing, you could use .flags if you want to specify it as 3rd param.
Isn't the 4th param of set_task() to send data to the called function ?
I missed the 3th param but don't you have to set the 4th and 5th param to _ too if you don't use .flags ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-04-2011 , 20:51   Re: Ambience Sound + Loop
Reply With Quote #6

Hmm oh yes, my bad... but still, the first _, is useless anyway, so you could just:
Code:
set_task(96.0, "emitSound", .flags = "b")
__________________
Hunter-Digital 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 17:32.


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