AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   RoundSound with mp3 (https://forums.alliedmods.net/showthread.php?t=216673)

deadbunny 05-24-2013 06:04

RoundSound with mp3
 
Hello !
I find a roundsound playing .mp3 .... But, when the next round starts, the music stops, song doesn't finish to play... Can you fix for me? (for the song is allowed to finishes...)
Code:

#include <amxmodx>       

#include <amxmisc>       

#include <engine>



public plugin_init()

{

register_plugin("RoundSound mod","1.1 mod","PaintLancer-mod by Dzek")

register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")

register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")

}

public t_win()

{

new rand = random_num(0,2)

client_cmd(0,"stopsound")

switch(rand)

{

case 0: play_any_sound("jbxfreakzmp3/foc.mp3")

case 1: play_any_sound("jbxfreakzmp3/celebrii.mp3")

case 2: play_any_sound("jbxfreakzmp3/gangstaintro.mp3")



}

return PLUGIN_HANDLED

}

public ct_win()

{

new rand = random_num(0,2)

client_cmd(0,"stopsound")

switch(rand)

{

case 0: play_any_sound("jbxfreakzmp3/mercedes.mp3")

case 1: play_any_sound("jbxfreakzmp3/apa.mp3")

case 2: play_any_sound("jbxfreakzmp3/hero.mp3")

}

return PLUGIN_HANDLED

}

public play_any_sound(sound[])

{

new is_mpeg = ( containi(sound, ".mp") != -1 )

if ( is_mpeg )

client_cmd(0, "mp3 play ^"sound/%s^"", sound)

else

client_cmd(0, "spk ^"%s^"", sound)

}



public plugin_precache()

{

precache_sound("jbxfreakzmp3/hero.mp3")

precache_sound("jbxfreakzmp3/apa.mp3")

precache_sound("jbxfreakzmp3/mercedes.mp3")

precache_sound("jbxfreakzmp3/gangstaintro.mp3")

precache_sound("jbxfreakzmp3/celebrii.mp3")

precache_sound("jbxfreakzmp3/foc.mp3")



return PLUGIN_CONTINUE

}

I would like to post only the part where I have to change, not all sma ...

ironskillz1 05-24-2013 07:15

Re: RoundSound with mp3
 
Remove all this from the sma
client_cmd(0,"stopsound")

deadbunny 05-25-2013 09:43

Re: RoundSound with mp3
 
Doesn't work.


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

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