sckatchof Posted January 8, 2012 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 )
myonlake Posted January 8, 2012 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 If I helped you, please click the like button on the right Thanks!
FatalTerror Posted January 8, 2012 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 Paid developer. Twitter: @willia_am - http://www.williamdasilva.fr
myonlake Posted January 8, 2012 Posted January 8, 2012 Not anymore, FatalTerror. If I helped you, please click the like button on the right Thanks!
FatalTerror Posted January 8, 2012 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) Paid developer. Twitter: @willia_am - http://www.williamdasilva.fr
myonlake Posted January 8, 2012 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 If I helped you, please click the like button on the right Thanks!
sckatchof Posted January 10, 2012 Author 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 .
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