Jump to content

Stream music and map music


3HAXAPb94

Recommended Posts

  
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 by Guest
Link to comment
  
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...