Jump to content

Need Help


sckatchof

Recommended Posts

hi guys ,when i leave area ==>> like this picture

gg.png

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

Edited by Guest
Link to comment

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
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
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

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...