This script in the initPlayerLocal.sqf will play a continuous jukebox of music in your Arma 3 mission. This is just like in Warlords where you have continuous background music.
_null = [] spawn { _musicPool = "getText (_x >> 'name') != '' && getNumber (_x >> 'duration') > 20" configClasses (configFile >> "CfgMusic"); _poolSize = count _musicPool; sleep 5; 0 fadeMusic 0.1; KER_DS_musicStopped = FALSE; addMusicEventHandler ["MusicStop", {KER_DS_musicStopped = TRUE}]; while {TRUE} do { 0 fademusic 0.2; _trackClass = _musicPool # floor random _poolSize; playMusic configName _trackClass; waitUntil {KER_DS_musicStopped}; KER_DS_musicStopped = FALSE; sleep 1; }; }; |
Another option is to use this function.
[] call BIS_fnc_jukebox; |
This will play random music in the background of your mission.