I have no clue how that works.
EDIT:
Alright, currently got this:
PHP Code:
#include <amxmodx>
#include <cstrike>
#define music 4
new g_MaxPlayers;
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");
g_MaxPlayers = get_maxplayers();
}
public round_end_event()
client_cmd(0,"mp3 stop");
public Event_PlayerKilled (id)
{
new r = random_num(0,music-1);
for (new Client = 1; Client <= g_MaxPlayers; Client++)
{
if (!is_user_connected(Client))
continue;
switch (get_user_team(Client))
{
case 1: // Terrorist
{
client_cmd(id,"mp3 play %s",mp3list[r]);
}
case 2: // CT
{
client_cmd(id,"mp3 play %s",mp3list[r]);
}
}
}
}
The problem with this one is if I kill a enemy, it play the song to me.
Supposed to be contrary.
Right now I have no idea how to fix this.
Appreciate help.