NullSystemWorks / mtadayz

Official MTA:DayZ Repository
Other
40 stars 35 forks source link

sounds day&night #169

Closed axelmine closed 6 years ago

axelmine commented 6 years ago

Please add function play sounds day and night

my code your fix

function playBackgroundSound() local hour,minutes = getTime( ) if hour >= 6 and hour < 12 then if time == 0 or (time ~= 1 and isElement(sound)) then stopSound(sound) sound = playSound ( "day.mp3",true ) end time = 1 elseif ( hour >= 12 ) and ( hour < 15 ) then if time == 0 or (time ~= 1 and isElement(sound)) then stopSound(sound) sound = playSound ( "day.mp3",true ) end time = 1 elseif ( hour >= 15 ) and ( hour < 20 ) then if time == 0 or (time ~= 2 and isElement(sound)) then stopSound(sound) sound = playSound ( "night.mp3",true ) end time = 2 elseif ( hour >= 20 ) and ( hour < 24 ) then if time == 0 or (time ~= 2 and isElement(sound)) then stopSound(sound) sound = playSound ( "night.mp3",true ) end time = 2 end end

neves768 commented 6 years ago

You could make a pull request

mtadayz commented 6 years ago

That code won't work as we're missing "day.mp3" and "night.mp3". Besides, there's really no need for even more ambience sounds, as we already have this playing in the background. Sorry, but I'm not going to accept this at its current state, which is why I'm closing this issue.