diff --git a/Nasal/aircraft.nas b/Nasal/aircraft.nas index 90f9df130..6209abadc 100644 --- a/Nasal/aircraft.nas +++ b/Nasal/aircraft.nas @@ -890,6 +890,27 @@ var autotrim = { +# teleport +# ============================================================================= +# Usage: aircraft.teleport(lat:48.3, lon:32.4, alt:5000); +# +var teleport = func(airport = "", runway = "", lat = -9999, lon = -9999, alt = 0, + speed = 0, distance = 0, azimuth = 0, glideslope = 0, heading = 9999) { + setprop("/sim/presets/airport-id", airport); + setprop("/sim/presets/runway", runway); + setprop("/sim/presets/latitude-deg", lat); + setprop("/sim/presets/longitude-deg", lon); + setprop("/sim/presets/altitude-ft", alt); + setprop("/sim/presets/airspeed-kt", speed); + setprop("/sim/presets/offset-distance-nm", distance); + setprop("/sim/presets/offset-azimuth-nm", azimuth); + setprop("/sim/presets/glideslope-deg", glideslope); + setprop("/sim/presets/heading-deg", heading); + fgcommand("presets-commit"); +} + + + # HUD control class to handle both HUD implementations # ============================================================================== #