Hello. I'm new in this forum. I need help with my sound plugin, which plays a random sound on TR/CT winning ( depending which one ). I extracted selected parts from some of my favorite musics, and saved as .wav. The plugin will play songs.. but the problem is that all of these songs doesn't stops... Just the file:
rollingstar.wav
I dont know why. Hope you can help me. My code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <csx>
#define PLUGIN "Death"
#define VERSION "2.0"
#define AUTHOR "felipe"
#pragma tabsize 0
new sounds[][] =
{
"misc/rollingstar.wav",
"misc/clubcanthandle.wav",
"misc/control.wav",
"misc/loveisgone.wav",
"misc/gottaremix.wav",
"misc/tiesto.wav",
"misc/girl.wav",
"misc/partyanimal.wav",
"misc/gettinover.wav",
"misc/rollerhead.wav",
"misc/owlcity.wav"
};
public plugin_precache()
{
for ( new i; i == sizeof sounds; i++ )
{
precache_sound( sounds[ i ] );
}
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin("Die Music","1.0","Punani")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
return PLUGIN_CONTINUE
}
public t_win()
{
client_cmd(0,"stopsound")
play_sound("misc/rollingstar")
return PLUGIN_HANDLED
}
public ct_win()
{
client_cmd(0,"stopsound")
play_sound("misc/owlcity")
return PLUGIN_HANDLED
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
static killerName[32], victimName[32], message[128];
new selfkill = (killer == victim) ? 1 : 0
if(selfkill || killer == victim || killer == 0 || wpnindex == CSW_HEGRENADE && selfkill == 0)
{
//client_cmd(0,"mp3 play sound/misc/end1.mp3")
play_sound("misc/burico")
get_user_name(victim, victimName, 31)
formatex(message, sizeof(message),"%s se matou ! ! !",victimName);
client_print(0, print_center, message);
}
if(wpnindex == CSW_KNIFE)
{
play_sound("misc/cadechinelo")
}
return PLUGIN_CONTINUE
}
public eEndRound()
{
client_cmd(0,"stopsound")
return PLUGIN_CONTINUE
}
public play_sound(sound[])
{
new players[32], pnum
get_players(players, pnum, "c")
new i
for (i = 0; i < pnum; i++)
{
if (is_user_connecting(players[i]))
continue
client_cmd(players[i], "spk %s", sound)
}
}
This one is moddified, since I was tryin to check if any other songs wouldn't stop