var resume_state = func (lat, lon, heading) {

    setprop("/sim/presets/airport-id", "");
    setprop("/sim/presets/latitude-deg", lat);
    setprop("/sim/presets/longitude-deg", lon);
    #var pitch = getprop("/save/pitch-deg");
    #setprop("/sim/presets/pitch-deg", pitch);
    #var roll = getprop("/save/roll-deg");
    #setprop("/sim/presets/roll-deg", roll);
    #var uBody = getprop("/save/uBody-fps");
    #setprop("/sim/presets/uBody-fps", uBody);
    #var vBody = getprop("/save/vBody-fps");
    #setprop("/sim/presets/vBody-fps", vBody);
    #var wBody = getprop("/save/wBody-fps");
    #setprop("/sim/presets/wBody-fps", wBody);
    setprop("/sim/presets/altitude-ft", -9999);
    setprop("/sim/presets/airspeed-kt", 0);
    setprop("/sim/presets/offset-distance-nm", 0);
    setprop("/sim/presets/glideslope-deg", 0);
    setprop("/sim/presets/runway", "");
    setprop("/sim/presets/parkpos", "");
    setprop("/sim/presets/runway-requested", 0);

    #var heading = getprop("/save/heading-deg");
    setprop("/sim/presets/heading-deg", heading);


    fgcommand("reposition");

    var load_delay = 0.001;
    settimer(func {

        setprop("/controls/engines/engine[0]/throttle", 0);
        setprop("/controls/gear/peddling", 0);
        setprop("/controls/gear/brake-parking", 1);

        print("State resumed!");

    }, load_delay);
}