;Unit that has the action
_unitacc = _this select 0
;Unit that activated the action
_unit = _this select 1
;Action index
_actionidx = _this select 2
_unitacc removeAction _actionidx

deleteVehicle musiclog
musiclog = "logic" camCreate getPos _unitacc

? damage record > 0.9:deleteVehicle musiclog:exit
_unitacc stop _mus
_ssdmusic = ["bless","wank","howi","run","whodo","window","tip","white","matilda","meet","under","always","bye","great","raf","para","dam","bat","buster"]
;Put here the durations of your tunes

_unitacc stop _mus 
_maxtracks = count _ssdmusic
#selecttrack
_r1 = random (count _ssdmusic)
_r1 = _r1 - (_r1 mod 1)
_mus = _ssdmusic select _r1
?_track == musictrack: goto "selecttrack"
musiclog say _mus
;Action will be available again once the tune is completed

_unitacc AddAction ["Turn on British Record player","track.sqs"]
exit





