Code:
function PlayMusicExt takes string Normal, string External returns nothing
local integer i=0
local string s
loop
exitwhen i>11
if GetLocalPlayer()== Player(i) then
if GetSoundFileDuration(External) > 0 then
set s=External
else
set s=Normal
endif
endif
call StopMusic(false)
call PlayMusic(s)
set i=i+1
endloop
endfunction
If I call this using 2 strings (1 of an imported file, the 2nd of another mp3 in a folder players would have to import)
While testing in single player, events after calling this function won't happen, IF Music is off. I'm guessing its something with PlayMusic, just speculation. I might have to disect this function and try to findout what exactly causes this.
edit: I moved these two lines to after the loop, where they should've been.
Code:
call StopMusic(false)
call PlayMusic(s)
Last edited: