Jump to content

#help# stream john f kennedy airport in all my aircraft


Recommended Posts

Not sure if this is what you want, please edit it if it has errors:

local soundLocation = 'http://d.liveatc.net/kjfk_twr' 
local soundMessage = 'Connecting to air traffic control (jka), please stand by.' 
  
addEventHandler('onClientResourceStart', getRootElement(), 
function(startedRes) 
    if startedRes == getThisResource() then 
        if isPedInVehicle(localPlayer) and getVehicleType(getPedOccupiedVehicle(localPlayer)) == 'Plane' then 
            if getRadioChannel() ~= 0 then 
                soundElement = playSound(soundLocation) 
                outputChatBox(soundMessage) 
            end 
        end 
    end 
end ) 
  
addEventHandler('onClientPlayerRadioSwitch', getRootElement(), 
function(radioID) 
    if isPedInVehicle(localPlayer) and getVehicleType(getPedOccupiedVehicle(localPlayer)) == 'Plane' then 
        if radioID ~= 0 then 
            cancelEvent() 
            soundElement = playSound(soundLocation) 
            outputChatBox(soundMessage) 
        elseif soundElement then 
            setRadioChannel(0) 
            stopSound(soundElement) 
            soundElement = nil 
        end 
    end 
end ) 
  
addEventHandler('onClientPlayerVehicleEnter', getRootElement(), 
function(theVehicle, theSeat) 
    if getVehicleType(theVehicle) == 'Plane' then 
        if getRadioChannel() ~= 0 then 
            soundElement = playSound(soundLocation) 
            outputChatBox(soundMessage) 
        end 
    end 
end ) 
  
addEventHandler('onClientPlayerVehicleExit', getRootElement(), 
function(theVehicle, theSeat) 
    if getVehicleType(theVehicle) == 'Plane' then 
        if soundElement then 
            setRadioChannel(0) 
            stopSound(soundElement) 
            soundElement = nil 
        end 
    end 
end ) 

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