004F: create_thread @ON_AND_OFF

:ON_AND_OFF
03A4: name_thread "ON_AND_OFF" 

:ON_AND_OFF_14
0001: wait 50 ms 
00D6: if 
0256:   is_player $PLAYER_CHAR playing 
004D: jump_if_false @ON_AND_OFF_258 
00D6: if 
00DF:   is_actor $PLAYER_ACTOR driving 
004D: jump_if_false @ON_AND_OFF_258 
0001: wait 50 ms 
00D6: if and
00E1:   is_button_pressed_pad 0 button 17 
00E1:   is_button_pressed_pad 0 button 19 
004D: jump_if_false @ON_AND_OFF_258 
0006: 3@ = 1 // L = INT 
0006: 33@ = 0 // L = INT 

:ON_AND_OFF_91
8029:   not  33@ >= 2000 // L >= INT 
004D: jump_if_false @ON_AND_OFF_154 
0001: wait 0 ms 
00D6: if or
80E1:   not is_button_pressed_pad 0 button 17 
80E1:   not is_button_pressed_pad 0 button 19 
004D: jump_if_false @ON_AND_OFF_147 
0006: 3@ = 0 // L = INT 
0002: jump @ON_AND_OFF_154 

:ON_AND_OFF_147
0002: jump @ON_AND_OFF_91 

:ON_AND_OFF_154
03C0: get_actor 1@ vehicle_handle_to $PLAYER_ACTOR //class B 
00D6: if 
0039:   3@ == 1 // L == INT 
004D: jump_if_false @ON_AND_OFF_211 
02D4: set_vehicle 1@ engine_operation 
067F: set_vehicle 1@ headlights 0 
0006: 0@ = 2 // L = INT 
0633: AS_actor $PLAYER_ACTOR exit_vehicle 
0002: jump @ON_AND_OFF_258 

:ON_AND_OFF_211
067F: set_vehicle 1@ headlights 0@ 
00D6: if 
0039:   0@ == 2 // L == INT 
004D: jump_if_false @ON_AND_OFF_251 
0006: 0@ = 0 // L = INT 
0002: jump @ON_AND_OFF_258 

:ON_AND_OFF_251
0006: 0@ = 2 // L = INT 

:ON_AND_OFF_258
0002: jump @ON_AND_OFF_14 
