Advertisement
glitchdetector

atc/client.lua

Aug 5th, 2018
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.43 KB | None | 0 0
  1. --====================================================================================
  2. -- ATC script made by GlitchDetector for Transport Tycoon
  3. -- Original Menu Script Author: Jonathan D @ Gannon
  4. --      https://www.twitch.tv/n3mtv
  5. --      https://twitter.com/n3m_tv
  6. --      https://www.facebook.com/lan3mtv
  7. --====================================================================================
  8.  
  9. function landMenu(data)
  10.     for k,v in next, data do
  11.         Citizen.Trace(tostring(k) .. ": " .. tostring(v))
  12.     end
  13.     TriggerEvent('chatMessage', "", {255, 0, 0}, "Function call: " .. data.Title)
  14.     if data.extraData ~= nil then
  15.         TriggerEvent('chatMessage', "", {255, 0, 0}, "extraData : " .. data.extraData)
  16.     end
  17. end
  18.  
  19. function takeoffMenu(data)
  20.     landMenu(data)
  21. end
  22.  
  23. function takeoffMarker(pos)
  24.     createFlashingBlip(pos, 549, 30)
  25. end
  26.  
  27. function landMarker(pos)
  28.     createFlashingBlip(pos, 556, 30)
  29. end
  30.  
  31. function createFlashingBlip(pos, blipid, time, col, override)
  32.     TriggerServerEvent('atc:flashingBlip', pos, blipid, time, col or 46, override or 0)
  33. end
  34.  
  35. function callATC(region, method, runway, p4, override)
  36.     local msg = "^1%s ATC: ^r^3%s ^0is preparing ^1%s ^r^0at runway ^2%s"
  37.     if p4 or 0 then
  38.         msg = "^1%s ATC: ^r^3%s ^0is preparing ^1%s ^r^0at ^2%s"
  39.     end
  40.     local name = GetPlayerName(PlayerId())
  41.     msg = string.format(msg, region, name, method, runway)
  42.     TriggerServerEvent('atc:message', msg, override or 0)
  43. end
  44.  
  45. function takeoffLSIA(data)
  46.     takeoffMarker(data.extraData.pos)
  47.     callATC("L.S.I.A", "takeoff", data.extraData.runway)
  48. end
  49.  
  50. function takeoffSandy(data)
  51.     takeoffMarker(data.extraData.pos)
  52.     callATC("Sandy Shores", "takeoff", data.extraData.runway)
  53. end
  54.  
  55. function takeoffZancudo(data)
  56.     takeoffMarker(data.extraData.pos)
  57.     callATC("Zancudo", "takeoff", data.extraData.runway)
  58. end
  59.  
  60. function takeoffMcKenzie(data)
  61.     takeoffMarker(data.extraData.pos)
  62.     callATC("McKenzie", "takeoff", data.extraData.runway)
  63. end
  64.  
  65. function takeoffPaleto(data)
  66.     takeoffMarker(data.extraData.pos)
  67.     callATC("Paleto Bay", "takeoff", data.extraData.runway)
  68. end
  69.  
  70. function takeoffPacific(data)
  71.     takeoffMarker(data.extraData.pos)
  72.     callATC("Pacific Ocean", "takeoff", data.extraData.runway)
  73. end
  74.  
  75. function takeoffCarrier(data)
  76.     takeoffMarker(data.extraData.pos)
  77.     callATC("Aircraft Carrier", "takeoff", data.extraData.runway)
  78. end
  79.  
  80. -- LANDING
  81. function landLSIA(data)
  82.     landMarker(data.extraData.pos)
  83.     callATC("L.S.I.A", "to land", data.extraData.runway)
  84. end
  85.  
  86. function landSandy(data)
  87.     landMarker(data.extraData.pos)
  88.     callATC("Sandy Shores", "to land", data.extraData.runway)
  89. end
  90.  
  91. function landZancudo(data)
  92.     landMarker(data.extraData.pos)
  93.     callATC("Zancudo", "to land", data.extraData.runway)
  94. end
  95.  
  96. function landMcKenzie(data)
  97.     landMarker(data.extraData.pos)
  98.     callATC("McKenzie", "to land", data.extraData.runway)
  99. end
  100.  
  101. function landPaleto(data)
  102.     landMarker(data.extraData.pos)
  103.     callATC("Paleto Bay", "to land", data.extraData.runway)
  104. end
  105.  
  106. function landPacific(data)
  107.     landMarker(data.extraData.pos)
  108.     callATC("Pacific Ocean", "to land", data.extraData.runway)
  109. end
  110.  
  111. function landCarrier(data)
  112.     landMarker(data.extraData.pos)
  113.     callATC("Aircraft Carrier", "to land", data.extraData.runway)
  114. end
  115.  
  116.  
  117. function sendLocation()
  118.     local pos = GetEntityCoords(GetPlayerPed(-1))
  119.     pos = {x=pos.x,y=pos.y,z=pos.z}
  120.     createFlashingBlip(pos, 307, 30, 4)
  121. end
  122.  
  123. function emergencyLanding()
  124.     local pos = GetEntityCoords(GetPlayerPed(-1))
  125.     callATC("Emergency", "emergency landing", string.format("%i°N %i°E", math.floor(pos.y), math.floor(pos.x)), 0, true)
  126.     pos = {x=pos.x,y=pos.y,z=pos.z}
  127.     createFlashingBlip(pos, 556, 30, true)
  128. end
  129.  
  130. function mayday()
  131.     local pos = GetEntityCoords(GetPlayerPed(-1))
  132.     callATC("Emergency", "emergency landing", string.format("%i°N %i°E", math.floor(pos.y), math.floor(pos.x)), 0, true)
  133.     pos = {x=pos.x,y=pos.y,z=pos.z}
  134.     createFlashingBlip(pos, 556, 30, true, true)
  135. end
  136.  
  137. --====================================================================================
  138. --  Build Menu
  139. --====================================================================================
  140. Menu = {}
  141. Menu.item = {
  142.     ['Title'] = 'ATC Menu',
  143.     ['Items'] = {
  144.         {['Title'] = 'L.S.I.A', ['SubMenu'] = {
  145.             ['Title'] = 'ATC L.S.I.A',
  146.             ['Items'] = {
  147.                 { ['Title'] = '~g~Land ~y~3 / 21 ~b~(Jet)', ['Function'] = landLSIA, ['extraData'] = {runway = '3 / 21 (JET)', pos = {x = -1484.241333, y = -2467.335449, z = 12.945147}} },
  148.                 { ['Title'] = '~g~Land ~y~30R / 12L ~r~(Main)', ['Function'] = landLSIA, ['extraData'] = {runway = '30R / 12L (MAIN)', pos = {x = -1291.800293, y = -2973.775635, z = 12.944430}} },
  149.                 { ['Title'] = '~g~Land ~y~30L / 12R ~g~(Side)', ['Function'] = landLSIA, ['extraData'] = {runway = '30L / 12R (SIDE)', pos = {x = -1386.934204, y = -3114.256836, z = 12.944432}} },
  150.                 { ['Title'] = '~b~Takeoff ~y~3 / 21 ~b~(Jet)', ['Function'] = takeoffLSIA, ['extraData'] = {runway = '3 / 21 (JET)', pos = {x = -1484.241333, y = -2467.335449, z = 12.945147}} },
  151.                 { ['Title'] = '~b~Takeoff ~y~30R / 12L ~r~(Main)', ['Function'] = takeoffLSIA, ['extraData'] = {runway = '30R / 12L (MAIN)', pos = {x = -1291.800293, y = -2973.775635, z = 12.944430}} },
  152.                 { ['Title'] = '~b~Takeoff ~y~30L / 12R ~g~(Side)', ['Function'] = takeoffLSIA, ['extraData'] = {runway = '30L / 12R (SIDE)', pos = {x = -1386.934204, y = -3114.256836, z = 12.944432}} },
  153.             }
  154.         }},
  155.         {['Title'] = 'Sandy Shores', ['SubMenu'] = {
  156.             ['Title'] = 'ATC Sandy Shores',
  157.             ['Items'] = {
  158.                 { ['Title'] = '~g~Land ~y~5 / 23 ~b~(Jet)', ['Function'] = landSandy, ['extraData'] = {runway = '5 / 23 (JET)', pos = {x = 1500.337769, y = 3094.885986, z = 39.531616}} },
  159.                 { ['Title'] = '~g~Land ~y~26L / 8R ~g~(Side)', ['Function'] = landSandy, ['extraData'] = {runway = '26L / 8R (SIDE)', pos = {x = 1354.870361, y = 3088.605713, z = 39.534142}} },
  160.                 { ['Title'] = '~g~Land ~y~26R / 8L ~r~(Main)', ['Function'] = landSandy, ['extraData'] = {runway = '26R / 8L (MAIN)', pos = {x = 1337.828125, y = 3151.860107, z = 39.414097}} },
  161.                 { ['Title'] = '~b~Takeoff ~y~5 / 23 ~b~(Jet)', ['Function'] = takeoffSandy, ['extraData'] = {runway = '5 / 23 (JET)', pos = {x = 1500.337769, y = 3094.885986, z = 39.531616}} },
  162.                 { ['Title'] = '~b~Takeoff ~y~26L / 8R ~g~(Side)', ['Function'] = takeoffSandy, ['extraData'] = {runway = '26L / 8R (SIDE)', pos = {x = 1354.870361, y = 3088.605713, z = 39.534142}} },
  163.                 { ['Title'] = '~b~Takeoff ~y~26R / 8L ~r~(Main)', ['Function'] = takeoffSandy, ['extraData'] = {runway = '26R / 8L (MAIN)', pos = {x = 1337.828125, y = 3151.860107, z = 39.414097}} },
  164.             }
  165.         }},
  166.         {['Title'] = 'Zancudo', ['SubMenu'] = {
  167.             ['Title'] = 'ATC Zancudo',
  168.             ['Items'] = {
  169.                 { ['Title'] = '~g~Land ~y~33 / 15 ~b~(Jet)', ['Function'] = landZancudo, ['extraData'] = {runway = '33 / 15 (JET)', pos = {x = -2480.605225, y = 3235.851807, z = 31.925560}} },
  170.                 { ['Title'] = '~g~Land ~y~30 / 12 ~r~(Main)', ['Function'] = landZancudo, ['extraData'] = {runway = '30 / 12 (MAIN)', pos = {x = -2375.579834, y = 3070.625732, z = 31.825928}} },
  171.                 { ['Title'] = '~b~Takeoff ~y~33 / 15 ~b~(Jet)', ['Function'] = takeoffZancudo, ['extraData'] = {runway = '33 / 15 (JET)', pos = {x = -2480.605225, y = 3235.851807, z = 31.925560}} },
  172.                 { ['Title'] = '~b~Takeoff ~y~30 / 12 ~r~(Main)', ['Function'] = takeoffZancudo, ['extraData'] = {runway = '30 / 12 (MAIN)', pos = {x = -2375.579834, y = 3070.625732, z = 31.825928}} },
  173.             }
  174.         }},
  175.         {['Title'] = 'McKenzie', ['SubMenu'] = {
  176.             ['Title'] = 'ATC McKenzie',
  177.             ['Items'] = {
  178.                 { ['Title'] = '~g~Land ~y~25 / 7', ['Function'] = landMcKenzie, ['extraData'] = {runway = '25 / 7', pos = {x = 2030.718628, y = 4755.413574, z = 40.124157}} },
  179.                 { ['Title'] = '~b~Takeoff ~y~25 / 7', ['Function'] = takeoffMcKenzie, ['extraData'] = {runway = '25 / 7', pos = {x = 2030.718628, y = 4755.413574, z = 40.124157}} },
  180.             }
  181.         }},
  182.         {['Title'] = 'Paleto Bay', ['SubMenu'] = {
  183.             ['Title'] = 'ATC Paleto Bay',
  184.             ['Items'] = {
  185.                 { ['Title'] = '~g~Land ~y~5 / 23 ~b~(Jet)', ['Function'] = landPaleto, ['extraData'] = {runway = '5 / 23 (JET)', pos = {x = -380.410980, y = 6497.020508, z = 7.386814}} },
  186.                 { ['Title'] = '~g~Land ~y~7 / 25 ~r~(Main)', ['Function'] = landPaleto, ['extraData'] = {runway = '7 / 25 (MAIN)', pos = {x = -587.827454, y = 6474.951660, z = 6.639785}} },
  187.                 { ['Title'] = '~b~Takeoff ~y~5 / 23 ~b~(Jet)', ['Function'] = takeoffPaleto, ['extraData'] = {runway = '5 / 23 (JET)', pos = {x = -380.410980, y = 6497.020508, z = 7.386814}} },
  188.                 { ['Title'] = '~b~Takeoff ~y~7 / 25 ~r~(Main)', ['Function'] = takeoffPaleto, ['extraData'] = {runway = '7 / 25 (MAIN)', pos = {x = -587.827454, y = 6474.951660, z = 6.639785}} },
  189.             }
  190.         }},
  191.         {['Title'] = 'Pacific Ocean', ['SubMenu'] = {
  192.             ['Title'] = 'ATC Pacific Ocean',
  193.             ['Items'] = {
  194.                 { ['Title'] = '~g~Land ~y~17 / 35 ~b~(Jet)', ['Function'] = landPacific, ['extraData'] = {runway = '17 / 35 (JET)', pos = {x = 2907.530273, y = -980.678345, z = 7.899795}} },
  195.                 { ['Title'] = '~g~Land ~y~18 / ~y~36 ~r~(Main)', ['Function'] = landPacific, ['extraData'] = {runway = '18 / 36 (MAIN)', pos = {x = 2996.983398, y = -992.581482, z = 7.899790}} },
  196.                 { ['Title'] = '~g~Land ~y~9 / ~y~27 ~g~(Side)', ['Function'] = landPacific, ['extraData'] = {runway = '9 / 27 (SIDE)', pos = {x = 3310.866455, y = -822.977173, z = 7.889794}} },
  197.                 { ['Title'] = '~g~Land ~y~4 / ~y~22 ~g~(Diagonal)', ['Function'] = landPacific, ['extraData'] = {runway = '4 / 22 (DIAG)', pos = {x = 3261.814941, y = -676.519897, z = 7.889794}} },
  198.                 { ['Title'] = '~b~Takeoff ~y~17 / 35 ~b~(Jet)', ['Function'] = takeoffPacific, ['extraData'] = {runway = '17 / 35 (JET)', pos = {x = 2907.530273, y = -980.678345, z = 7.899795}} },
  199.                 { ['Title'] = '~b~Takeoff ~y~18 / 36 ~r~(Main)', ['Function'] = takeoffPacific, ['extraData'] = {runway = '18 / 36 (MAIN)', pos = {x = 2996.983398, y = -992.581482, z = 7.899790}} },
  200.                 { ['Title'] = '~b~Takeoff ~y~9 / 27 ~b~(Side)', ['Function'] = takeoffPacific, ['extraData'] = {runway = '9 / 27 (SIDE)', pos = {x = 3310.866455, y = -822.977173, z = 7.889794}} },
  201.                 { ['Title'] = '~b~Takeoff ~y~4 / 22 ~b~(Diagonal)', ['Function'] = takeoffPacific, ['extraData'] = {runway = '4 / 22 (DIAG)', pos = {x = 3261.814941, y = -676.519897, z = 7.889794}} },
  202.             }
  203.         }},
  204.         {['Title'] = 'Aircraft Carrier', ['SubMenu'] = {
  205.             ['Title'] = 'ATC Carrier',
  206.             ['Items'] = {
  207.                 { ['Title'] = '~g~Land ~y~CV-96', ['Function'] = landCarrier, ['extraData'] = {runway = 'CV-96', pos = {x = 3049.651367, y = -4702.908691, z = 13.837625}} },
  208.                 { ['Title'] = '~b~Takeoff ~y~CV-96', ['Function'] = takeoffCarrier, ['extraData'] = {runway = 'CV-96', pos = {x = 3049.651367, y = -4702.908691, z = 13.837625}} }
  209.             }
  210.         }},
  211.         {['Title'] = '~y~Misc ATC', ['SubMenu'] = {
  212.             ['Title'] = 'Misc ATC',
  213.             ['Items'] = {
  214.                 { ['Title'] = 'Broadcast Location', ['Function'] = sendLocation},
  215.                 { ['Title'] = '~y~Emergency Landing', ['Function'] = emergencyLanding},
  216.                 { ['Title'] = '~r~Mayday', ['Function'] = mayday},
  217.             }
  218.         }},
  219.     }
  220. }
  221. --====================================================================================
  222. --  Option Menu
  223. --====================================================================================
  224. Menu.backgroundColor = { 52, 73, 94, 196 }
  225. Menu.backgroundColorActive = { 22, 160, 134, 255 }
  226. Menu.tileTextColor = { 22, 160, 134, 255 }
  227. Menu.tileBackgroundColor = { 255,255,255, 255 }
  228. Menu.textColor = { 255,255,255,255 }
  229. Menu.textColorActive = { 255,255,255, 255 }
  230.  
  231. Menu.keyOpenMenu = 99 -- TAB
  232. Menu.keyOpenMenu2 = 179 -- CONTROLLER SQUARE/X MMB
  233. Menu.keyUp = 172 -- PhoneUp
  234. Menu.keyDown = 173 -- PhoneDown
  235. Menu.keyLeft = 174 -- PhoneLeft || Not use next release Maybe
  236. Menu.keyRight = 175 -- PhoneRigth || Not use next release Maybe
  237. Menu.keySelect = 176 -- PhoneSelect
  238. Menu.KeyCancel = 177 -- PhoneCancel
  239.  
  240. Menu.posX = 1 - 0.3
  241. Menu.posY = 1 - 0.7
  242.  
  243. Menu.ItemWidth = 0.20
  244. Menu.ItemHeight = 0.03
  245.  
  246. Menu.isOpen = false   -- /!\ Ne pas toucher
  247. Menu.currentPos = {1} -- /!\ Ne pas toucher
  248.  
  249. --====================================================================================
  250. --  Menu System
  251. --====================================================================================
  252.  
  253. function Menu.drawRect(posX, posY, width, heigh, color)
  254.     DrawRect(posX + width / 2, posY + heigh / 2, width, heigh, color[1], color[2], color[3], color[4])
  255. end
  256.  
  257. function Menu.initText(textColor, font, scale)
  258.     font = font or 0
  259.     scale = scale or 0.35
  260.     SetTextFont(font)
  261.     SetTextScale(0.0,scale)
  262.     SetTextCentre(true)
  263.     SetTextDropShadow(0, 0, 0, 0, 0)
  264.     SetTextEdge(0, 0, 0, 0, 0)
  265.     SetTextColour(textColor[1], textColor[2], textColor[3], textColor[4])
  266.     SetTextEntry("STRING")
  267. end
  268.  
  269. function Menu.draw()
  270.     -- Draw Rect
  271.     local pos = 0
  272.     local menu = Menu.getCurrentMenu()
  273.     local selectValue = Menu.currentPos[#Menu.currentPos]
  274.     local nbItem = #menu.Items
  275.     -- draw background title & title
  276.     Menu.drawRect(Menu.posX, Menu.posY , Menu.ItemWidth, Menu.ItemHeight * 2, Menu.tileBackgroundColor)
  277.     Menu.initText(Menu.tileTextColor, 4, 0.7)
  278.     AddTextComponentString(menu.Title)
  279.     DrawText(Menu.posX + Menu.ItemWidth/2, Menu.posY)
  280.  
  281.     -- draw bakcground items
  282.     Menu.drawRect(Menu.posX, Menu.posY + Menu.ItemHeight * 2, Menu.ItemWidth, Menu.ItemHeight + (nbItem-1)*Menu.ItemHeight, Menu.backgroundColor)
  283.     -- draw all items
  284.     for pos, value in pairs(menu.Items) do
  285.         if pos == selectValue then
  286.             Menu.drawRect(Menu.posX, Menu.posY + Menu.ItemHeight * (1+pos), Menu.ItemWidth, Menu.ItemHeight, Menu.backgroundColorActive)
  287.             Menu.initText(Menu.textColorActive)
  288.         else
  289.             Menu.initText(Menu.textColor)
  290.         end
  291.         AddTextComponentString(value.Title)
  292.         DrawText(Menu.posX + Menu.ItemWidth/2, Menu.posY + Menu.ItemHeight * (pos+1))
  293.     end
  294.  
  295. end
  296.  
  297. function Menu.getCurrentMenu()
  298.     local currentMenu = Menu.item
  299.     for i=1, #Menu.currentPos - 1 do
  300.         local val = Menu.currentPos[i]
  301.         currentMenu = currentMenu.Items[val].SubMenu
  302.     end
  303.     return currentMenu
  304. end
  305.  
  306. function Menu.initMenu()
  307.     Menu.currentPos = {1}
  308. end
  309.  
  310. function Menu.keyControl()
  311.     if IsControlJustPressed(1, Menu.keyDown) then
  312.         local cMenu = Menu.getCurrentMenu()
  313.         local size = #cMenu.Items
  314.         local slcp = #Menu.currentPos
  315.         Menu.currentPos[slcp] = (Menu.currentPos[slcp] % size) + 1
  316.  
  317.     elseif IsControlJustPressed(1, Menu.keyUp) then
  318.         local cMenu = Menu.getCurrentMenu()
  319.         local size = #cMenu.Items
  320.         local slcp = #Menu.currentPos
  321.         Menu.currentPos[slcp] = ((Menu.currentPos[slcp] - 2 + size) % size) + 1
  322.  
  323.     elseif IsControlJustPressed(1, Menu.KeyCancel) then
  324.         table.remove(Menu.currentPos)
  325.         if #Menu.currentPos == 0 then
  326.             Menu.isOpen = false
  327.         end
  328.  
  329.     elseif IsControlJustPressed(1, Menu.keySelect)  then
  330.         local cSelect = Menu.currentPos[#Menu.currentPos]
  331.         local cMenu = Menu.getCurrentMenu()
  332.         if cMenu.Items[cSelect].SubMenu ~= nil then
  333.             Menu.currentPos[#Menu.currentPos + 1] = 1
  334.         else
  335.             if cMenu.Items[cSelect].Function ~= nil then
  336.                 cMenu.Items[cSelect].Function(cMenu.Items[cSelect])
  337.             end
  338.             if cMenu.Items[cSelect].Event ~= nil then
  339.                 TriggerEvent(cMenu.Items[cSelect].Event, cMenu.Items[cSelect])
  340.             end
  341.             if cMenu.Items[cSelect].Close == nil or cMenu.Items[cSelect].Close == true then
  342.                 Menu.isOpen = false
  343.             end
  344.         end
  345.     end
  346.  
  347. end
  348.  
  349. Citizen.CreateThread(function()
  350.     while true do
  351.         Citizen.Wait(1)
  352.         if IsPedInAnyPlane(GetPlayerPed(-1)) or IsPedInAnyHeli(GetPlayerPed(-1)) then
  353.             if IsControlJustPressed(1, Menu.keyOpenMenu) then
  354.                 Menu.initMenu()
  355.                 Menu.isOpen = not Menu.isOpen
  356.             end
  357.             if Menu.isOpen then
  358.                 Menu.draw()
  359.                 Menu.keyControl()
  360.             end
  361.         end
  362.     end
  363. end)
  364.  
  365. RegisterNetEvent("atc:startFlashingBlip")
  366. AddEventHandler("atc:startFlashingBlip", function(pos, blipid, time, col, override)
  367.     if IsPedInAnyPlane(GetPlayerPed(-1)) or IsPedInAnyHeli(GetPlayerPed(-1)) or (override) then
  368.         local blip = AddBlipForCoord(pos.x, pos.y, pos.z)
  369.         SetBlipSprite(blip, blipid)
  370.         SetBlipColour(blip, col)
  371.         SetBlipDisplay(blip, 8)
  372.         SetBlipFlashes(blip, true)
  373.         SetBlipFlashInterval(blip, 400)
  374.         SetTimeout(time * 1000, function()
  375.             RemoveBlip(blip)
  376.         end)
  377.     end
  378. end)
  379.  
  380. RegisterNetEvent("atc:getMessage")
  381. AddEventHandler("atc:getMessage", function(msg, override)
  382.     if IsPedInAnyPlane(GetPlayerPed(-1)) or IsPedInAnyHeli(GetPlayerPed(-1)) or (override) then
  383.         TriggerEvent('chatMessage', "", {255, 0, 0}, msg)
  384.     end
  385. end)
  386.  
  387. RegisterNetEvent("atc:warning")
  388. AddEventHandler("atc:warning", function()
  389.     msg = "~r~ATC WARNING:~y~ Your callout conflicts with another player's. ~n~Please make a visual check before proceeding."
  390.     Citizen.Trace("Received ATC warning")
  391.     TriggerEvent("gd_utils:oneliner", msg, 10)
  392. end)
  393.  
  394. Citizen.CreateThread(function()
  395.     local inAircraft = false
  396.     while true do
  397.         Wait(50)
  398.         if not inAircraft and (IsPedInAnyPlane(GetPlayerPed(-1)) or IsPedInAnyHeli(GetPlayerPed(-1))) then
  399.             SetNotificationTextEntry("STRING")
  400.             AddTextComponentString("~w~Press ~g~TAB ~w~to open the ~y~ATC menu~w~.\nIt's ~r~mandatory ~w~to use when piloting!")
  401.             DrawNotification(false, false)
  402.         end
  403.         inAircraft = (IsPedInAnyPlane(GetPlayerPed(-1)) or IsPedInAnyHeli(GetPlayerPed(-1)))
  404.     end
  405. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement