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

End of sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 08-13-2020 , 08:12   End of sound
Reply With Quote #1

Hello
I want to play sound at the beginning and end of the round
PHP Code:
#include <amxmodx>

new sound_start[][] =
{
    
"start/1.wav",
    
"start/2.wav",
    
"start/3.wav"
}

new 
sound_end[][] =
{
    
"end/1.wav",
    
"end/2.wav",
    
"end/3.wav"
}

public 
plugin_precache()
{
    new 
i
    
for (i=0i<sizeof sound_start;i++)     precache_sound(sound_start[i])
    for (
i=0i<sizeof sound_end;i++)     precache_sound(sound_end[i])
}

public 
plugin_init( )
{
    
register_logevent("round_start",2,     "1=Round_Start")
    
register_logevent("round_end",2,     "1=Round_End")
}

public 
round_start()
{
    
client_cmd(0"spk %s"sound_start[random(sizeof sound_start)])
}

public 
round_end()
{
    
client_cmd(0"spk %s"sound_end[random(sizeof sound_end)])

But when the round starts
The sound of the end of the round is played together with the sound of the beginning of the round
PHP Code:
client_cmd(0"stopsound; mp3 stop"
But I can cut off the sound of the end of the round
But I want the start sound of the round to be played after the end of the round sound
That is, the previous sound ends and then the start sound of the round is played
I can not tell when the sound ends
amirwolf is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-13-2020 , 08:21   Re: End of sound
Reply With Quote #2

As far as I know you can't detect when a sound is being played for a client nor when it ends.

But as a tip make sure your end sounds are 5 seconds max in length
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 08-13-2020 , 08:23   Re: End of sound
Reply With Quote #3

The sound I use is more than 5 seconds
amirwolf is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-13-2020 , 08:26   Re: End of sound
Reply With Quote #4

Nvm I was mistaken about getting the sound duration, if you have searched you won't be asking.


Anyway here is a link to an include file you can use for such things

https://forums.alliedmods.net/showth...76259?t=176259
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 08-13-2020 , 08:28   Re: End of sound
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Nvm I was mistaken about getting the sound duration, if you have searched you won't be asking.


Anyway here is a link to an include file you can use for such things

https://forums.alliedmods.net/showth...76259?t=176259
I'm checking it
thank you
amirwolf 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 15:01.


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