PHP Code:
#include <amxmodx>
#define MUSIC_TIME 150 //Put here length of your sound track , for example if it has 1:20 minutes then put 80 (seconds)
#define REPEAT_TIMES 3 //How many times track repeats per round
new const g_sz_Music_File[] = "sound/music/my_track.mp3"; //change your directory or filename which you want
public plugin_precache ()
{
precache_generic( g_sz_Music_File );
}
public plugin_init ()
{
register_plugin ( "Music File Play", "1.0", "siriusmd99" );
register_logevent("event_Round_Start", 2, "1=Round_Start")
}
public event_Round_Start()
{
remove_task()
set_task(float(MUSIC_TIME), "repeat_track", .flags="a", .repeat = REPEAT_TIMES)
}
public repeat_track()
{
client_cmd(0, "stopsound;mp3 stop"); //Stop sounds in case music time is not defined corectly or another sound started to play
client_cmd ( 0, "mp3 play %s", g_sz_Music_File );
}