004F: create_thread @ENGINE_OFF

:ENGINE_OFF
0001: wait  500 ms    // ------------ 250 ms or 500 ms would be better here
00D6: if  1
0256:   player $PLAYER_CHAR defined
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @ENGINE_OFF  
03C0: 0@ = actor $PLAYER_ACTOR car

:ENGINE_OFF_1
0001: wait  500 ms    // ------------ 250 ms or 500 ms would be better here
00D6: if  1
0256:   player $PLAYER_CHAR defined
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @ENGINE_OFF                    
00D6: if  1
00E1:   key_pressed  0  6         // hand brake               Both buttons pressed at the same time
00E1:   key_pressed  0  18        // horn
004D: jump_if_false @ENGINE_OFF_1
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)    // -------- freeze player before shutdown
02D4: unknown_turn_off_car 0@ engine
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)  // --------- back to normal
       
:ENGINE_OFF_2
0001: wait  500 ms      
00D6: if  1
0256:   NOT   player $PLAYER_CHAR defined  
00DB:   NOT   actor $PLAYER_ACTOR in_car 0@  
004D: jump_if_false @ENGINE_OFF_2  
0002: jump @ENGINE_OFF