Right now this play MP3 to the victim only upon death.
I would like this to play to the victim's teammates only.
How to do that?
EDIT: Would like dead people to not be executed by this command either.
PHP Code:
#include <amxmodx>
#define music 4
new mp3list[music][] =
{
"file1.mp3",
"file2.mp3",
"file3.mp3",
"file4.mp3"
}
public plugin_init ()
{
register_plugin( "Sound On Death", "1.0", "Biscuit" );
register_event( "DeathMsg", "Event_PlayerKilled", "a" );
register_logevent("round_end_event", 2, "1=Round_End");
}
public round_end_event()
client_cmd(0,"mp3 stop")
public Event_PlayerKilled ()
{
//Get victim
new victim = read_data(2)
//play random mp3 in mp3list to victim
new r = random_num(0,music-1)
client_cmd(victim,"mp3 play %s",mp3list[r])
}