sckatchof Posted January 8, 2012 Share Posted January 8, 2012 hi guys ,when i leave area ==>> like this picture Client : addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) radio = playSound3D ( "http://www.true.nl/streams/slamfmlivestream.asx" , 251.5, -1890.8000488281, 3.7000000476837, true) setSoundVolume( radio, 4) setSoundMinDistance ( radio , 150 ) end ) Link to comment
myonlake Posted January 8, 2012 Share Posted January 8, 2012 (edited) local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local colShape = createColSphere(posX, posY, posZ, radius) local thisRoot = getResourceRootElement(getThisResource()) local root = getRootElement() addEventHandler("onClientResourceStart", thisRoot, function() local radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) addEventHandler("onClientResourceStop", thisRoot, function() destroyElement(colShape) end) addEventHandler("onColShapeLeave", root, function(leaveElement, matchingDimension) if getElementType(leaveElement) == "player" then outputChatBox("#FFFF00RADIO: #FFFFFFStream stopped.", 255, 255, 255, true) end end) Edited January 8, 2012 by Guest Link to comment
FatalTerror Posted January 8, 2012 Share Posted January 8, 2012 (edited) local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local thisRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart", thisRoot, function() radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) The same thing ^^ Edit: no Edited January 8, 2012 by Guest Link to comment
myonlake Posted January 8, 2012 Share Posted January 8, 2012 Not anymore, FatalTerror. Link to comment
FatalTerror Posted January 8, 2012 Share Posted January 8, 2012 Try that, edit for you script. local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local thisRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart", thisRoot, function() radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition(getLocalPlayer()) if x and y and z then local distance = getDistanceBetweenPoints3D(x, y, z, posX, posY, posZ) if distance >= radius then outputChatBox("You have left the song area !") end end end) Link to comment
myonlake Posted January 8, 2012 Share Posted January 8, 2012 Try that, edit for you script. local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local thisRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart", thisRoot, function() radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition(getLocalPlayer()) if x and y and z then local distance = getDistanceBetweenPoints3D(x, y, z, posX, posY, posZ) if distance >= radius then outputChatBox("You have left the song area !") end end end) That's one way aswell Link to comment
sckatchof Posted January 10, 2012 Author Share Posted January 10, 2012 Try that, edit for you script. local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local thisRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart", thisRoot, function() radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition(getLocalPlayer()) if x and y and z then local distance = getDistanceBetweenPoints3D(x, y, z, posX, posY, posZ) if distance >= radius then outputChatBox("You have left the song area !") end end end) thanks guys for help but same problem . 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