_trackList = ["Track01_Dead_Forest","Track02_Insertion","Track03_First_To_Fight","Track04_Reinforcements","Track05_Warpath","Track06_Abandoned_Battlespace","Track07_Last_Men_Standing","Track08_Harvest_Red",
"Track09_Movement_To_Contact","Track10_Logistics","Track11_Large_Scale_Assault","Track12_The_Movement","Track13_Sharping_Knives","Track14_Close_Quarter_Combat","Track15_Morning_Sortie",
"Track16_Valentine","Track17_Marauder_Song","Track18_Ghost_Waltz","Track19_Debriefing","Track20_Badlands","Track21_Rise_Of_The_Fallen","Track22_Chernarussian_Anthem","Track26_Organ_Works",
"Track27_Killing_Machines","Ambient01_Cold_Wind","Ambient02_Vague_Shapes","Ambient03_Indian_Summer","Ambient04_Electronic_Warfare","Ambient05_Cobalt","Ambient06_Khe_Sanh_Riff",
"Ambient07_Manhattan","Ambient08_Reforger","Short01_Defcon_Three","C2_ND_Ambient"];
while {true} do {
_song = _trackList select floor(random(count _tracklist));
_dur = 45;
_tT = time + _dur;
playmusic _song;
while {_tT > time} do {
_dist = player distance _this;
while {_dist <= 50 and (_tT > time)} do {
sleep 0.1;
_pos1 = getpos _this;
_pos2 = getpos player;
_dir1 = ((_pos1 select 0) - (_pos2 select 0)) atan2 ((_pos1 select 1) - (_pos2 select 1));
_dir2 = getdir player;
if (_dir1 < 0) then {_dir1 = 360 + _dir1};
_diff = (_dir2 max _dir1) - (_dir2 min _dir1);
if (_diff > 180) then {_diff = abs(_diff - 360)};
_volume = 1 min ((1 / _dist) * ((0.25 max (43 / _diff)) min 1));
0 fademusic _volume;
_dist = player distance _this;
};
0 fademusic 0;
sleep 1;
};
};
Sorted it!