004F: create_thread @MOTOR

:MOTOR
03A4: name_thread 'MT'

:MOTOR_1
0001: wait 0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MOTOR_1
00D6: if 1
00DF:   actor $PLAYER_ACTOR driving
00E1: key_pressed 0 10
004D: jump_if_false @MOTOR_1
03C0: 0@ = actor $PLAYER_ACTOR car
02D4: unknown_turn_off_car 0@ engine
067F: control_car 0@ lights 1

:MOTOR_2
0001: wait 0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @MOTOR_5
00D6: if  1
8119:   NOT   car 0@ wrecked
0202:   actor $PLAYER_ACTOR near_car 0@ radius  50.0  50.0 unknown  0
004D: jump_if_false @MOTOR_5
00D6: if 1
80DF:   NOT   actor $PLAYER_ACTOR driving
00E1: key_pressed 0 11
004D: jump_if_false @MOTOR_3
0407: create_coordinate 1@ 2@ 3@ from_car 0@ offset  0.0  0.1  0.0
02C2: car 0@ drive_to_point 1@ 2@ 3@
00AD: set_car 0@ max_speed_to  50.0
067F: control_car 0@ lights 2

:MOTOR_3
00D6: if 0
00E1: key_pressed 0 10
004D: jump_if_false @MOTOR_4
0001: wait  1000 ms
02D4: unknown_turn_off_car 0@ engine
067F: control_car 0@ lights 1

:MOTOR_4
00D6: if 0
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @MOTOR_2
00D6: if 0
00DB:   actor $PLAYER_ACTOR in_car 0@
004D: jump_if_false @MOTOR_5
00D6: if 0
00E1: key_pressed 0 11
004D: jump_if_false @MOTOR_2
0407: create_coordinate 1@ 2@ 3@ from_car 0@ offset  0.0  0.1  0.0
02C2: car 0@ drive_to_point 1@ 2@ 3@
00AD: set_car 0@ max_speed_to  50.0
067F: control_car 0@ lights 2
0050: gosub @MOTOR_6
0001: wait  0 ms
0792: $PLAYER_ACTOR//remove_actor  from_vehicle
016A: fade  1 (back)  1000 ms
036A: put_actor $PLAYER_ACTOR in_car 0@
0A30: repair_car 0@
0002: jump @MOTOR_2

:MOTOR_5
01C3: remove_references_to_car 0@// Like turning a car into any random car
0002: jump @MOTOR_1


:MOTOR_6
0169: set_fade_color  0  0  0
016A: fade  0 ()  500 ms

:MOTOR_7
00D6: if  0
016B:   fading
004D: jump_if_false @MOTOR_8
0001: wait  0 ms
0002: jump @MOTOR_7

:MOTOR_8
0051: return