3HAXAPb94 Posted March 16, 2014 Share Posted March 16, 2014 Hi all. How I can mute just map music not stream music? I want to make setting addCommandHandler /muteRadio then play map music if I write /playRadio then mapmusic stop playing. So anybody help me Link to comment
Anubhav Posted March 16, 2014 Share Posted March 16, 2014 -- For stoping stopSound -- for playing playSound Link to comment
3HAXAPb94 Posted March 16, 2014 Author Share Posted March 16, 2014 How I can check if playing map music and stream music Link to comment
Anubhav Posted March 16, 2014 Share Posted March 16, 2014 function bla() local theSound = playSound(....) local pause = isSoundPaused(theSound) if(pause == true) then -- you code end end Link to comment
3HAXAPb94 Posted March 16, 2014 Author Share Posted March 16, 2014 (edited) radioURL1 = "myRadioSTATION" function play () theRadio = playSound(radioURL1) end play () -- if radio dont play I need play map music... function mute () setSoundVolume(theRadio, 0) outputChatBox ("Radio muted") end addCommandHandler ("muteRadio",mute) --if play radio then stop map music but I dont know how to do it function playRadio () outputChatBox ("Radio unmuted") setSoundVolume(theRadio, 1) end addCommandHandler ("playRadio",playRadio) Edited March 16, 2014 by Guest Link to comment
Anubhav Posted March 16, 2014 Share Posted March 16, 2014 EDIT : What do you want in that code? Link to comment
3HAXAPb94 Posted March 16, 2014 Author Share Posted March 16, 2014 Stop map music and play radio. if I stop radio then play map music Link to comment
Anubhav Posted March 16, 2014 Share Posted March 16, 2014 radioURL1 = "myRadioSTATION" mapRadio = "myRadioSTATION2" function play () theRadio = playSound(radioURL1) setElementData(root,"radio",theRadio) end addEventHandler("onClientResourceStart",resourceRoot,play) addEventHandler("onClientPlayerJoin",root,play) function mute () setSoundVolume(theRadio, 0) outputChatBox ("Radio is muted") setElementData(source,"radio",false or nil) end addCommandHandler ("muteRadio",mute) function playRadio () setSoundVolume(theRadio, 1) if theRadio then outputChatBox("Radio is already playing!") return end else if getElementData(player,"mapRadio) == true then setElementData(player,"mapRadio",false or nil) setElementData(player,"radio",theRadio) outputChatBox("Radio is now playing!") end end addCommandHandler ("playRadio",playRadio) function playMapSound() local sound = getElementData(player,"radio") if sound == nil or false then local mapSound = playSound(mapRadio) setElementData(player,"mapradio",mapSound) end setTimer(playMapSound,1000,0) function stopMapMusic() local getEle = getElementData(player,"mapRadio) if getEle == false or nil then outputChatBox("Map sound is already muted.") return end else outputChatBox("Map sound is muted now!") setElementData(player,"mapRadio",false or nil) play() end addCommandHandler("mutemap",stopMapMusic) Link to comment
3HAXAPb94 Posted March 16, 2014 Author Share Posted March 16, 2014 Anubhav, map music its not stream this music in map folder for example music.mp3. It playing all times if map starting (onClientMapStarting). Link to comment
NeO_DUFFMAN Posted March 16, 2014 Share Posted March 16, 2014 I kind of get what your issue is. So basically you want to be able to pause the sound that is being played from a particular map and then play it again. Well then I'm pretty sure that you'll have to edit the lua file in that map folder. I don't see any other alternative option cause the song will be played since it's triggered by an event pertaining to that particular map' s lua file i.e onClientMapStarting. You would have to edit the function that's being triggered by this event in that file. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now