ik wil graag dit streamen "http://d.liveatc.net/kjfk_gnd" als ik in een vliegtuig de radio afzet ik heb een script van een andere topic gevonden maar die werkt bij mij niet, moet ik nog iets veranderen aan de meta.xml ?
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 )