004F: create_thread SNAKESPAWN00

:SNAKESPAWN00
0001: wait  0 ms
00D6: if  1
8241:   NOT   player $PLAYER_CHAR in_remote_mode
004D: jump_if_false SNAKESPAWN00
00D6: if  1
8449:   NOT   actor $PLAYER_ACTOR in_a_car
80DF:   NOT   actor $PLAYER_ACTOR driving
004D: jump_if_false SNAKESPAWN01
00D6: if  1
00E1:   key_pressed  0  14 ;; jump
00E1:   key_pressed  0  9 ;; group back
004D: jump_if_false SNAKESPAWN03
0002: jump SNAKESPAWN01D

:SNAKESPAWN01
00D6: if  0
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false SNAKESPAWN02
03C0: @0 = actor $PLAYER_ACTOR car
0441: $SNAKE_CSID = car @0 model
00D6: if  1
00E1:   key_pressed  0  14 ;; brake/reverse
00E1:   key_pressed  0  16 ;; gas
004D: jump_if_false SNAKESPAWN02
03F0:  1
0341:  1
03E4:  0
0348:  0
045A:  25.0 25.0 "NUMBER" $SNAKE_CSID
00D6: if  0
00E1:   key_pressed  0  7 ;; next weapon
004D: jump_if_false SNAKESPAWN01B
0008: $SNAKE_CSID +=  1  ;; integer values
00D6: if  0
0018:   $SNAKE_CSID >  611  ;; integer values
004D: jump_if_false SNAKESPAWN01B
0004: $SNAKE_CSID =  400  ;; integer values

:SNAKESPAWN01B
00D6: if  0
00E1:   key_pressed  0  5 ;; previous weapon
004D: jump_if_false SNAKESPAWN01C
000C: $SNAKE_CSID -=  1  ;; integer values
00D6: if  0
001A:    400 > $SNAKE_CSID  ;; integer values
004D: jump_if_false SNAKESPAWN01C
0004: $SNAKE_CSID =  611  ;; integer values

:SNAKESPAWN01C
00D6: if  0
80DD:   NOT   actor $PLAYER_ACTOR driving_vehicle_type $SNAKE_CSID
004D: jump_if_false SNAKESPAWN00
00D6: if  0
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false SNAKESPAWN01D
03C0: @0 = actor $PLAYER_ACTOR car
00AA: store_car @0 position_to @1 @2 @3
0174: @4 = car @0 z_angle
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at  @1 @2  @3
0002: jump SNAKESPAWN01E

:SNAKESPAWN01D
00A0: store_actor $PLAYER_ACTOR position_to @1 @2 @3
0172: @4 = actor $PLAYER_ACTOR z_angle

:SNAKESPAWN01E
00D6: if  21
0018:   $SNAKE_CSID >  611  ;; integer values
001A:    400 > $SNAKE_CSID  ;; integer values
004D: jump_if_false SNAKESPAWN01F
0004: $SNAKE_CSID =  400  ;; integer values

:SNAKESPAWN01F
0247: request_model  $SNAKE_CSID
038B: load_requested_models
00D6: if  0
0248:   model  $SNAKE_CSID available
004D: jump_if_false SNAKESPAWN00
00A6: destroy_car $SNAKECAR
00A5: $SNAKECAR = create_car  $SNAKE_CSID at @1 @2 @3
0175: set_car $SNAKECAR z_angle_to @4
036A: put_actor $PLAYER_ACTOR in_car $SNAKECAR
0249: release_model  $SNAKE_CSID
0001: wait  100 ms

:SNAKESPAWN02
00D6: if  0
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false SNAKESPAWN03
00D6: if  2
00E1:   key_pressed  0  4 ;; weapon2
00E1:   key_pressed  0  6 ;; handbrake
00E1:   key_pressed  0  5 ;; look left
004D: jump_if_false SNAKESPAWN02B
03C0: @0 = actor $PLAYER_ACTOR car
0441: $QSPAWNID1 = car @0 model
0002: jump SNAKESPAWN00

:SNAKESPAWN02B
00D6: if  2
00E1:   key_pressed  0  4 ;; weapon2
00E1:   key_pressed  0  6 ;; handbrake
00E1:   key_pressed  0  7 ;; look right
004D: jump_if_false SNAKESPAWN02C
03C0: @0 = actor $PLAYER_ACTOR car
0441: $QSPAWNID2 = car @0 model
0002: jump SNAKESPAWN00

:SNAKESPAWN02C
00D6: if  2
00E1:   key_pressed  0  4 ;; weapon2
00E1:   key_pressed  0  6 ;; handbrake
00E1:   key_pressed  0  9 ;; prev radio station
004D: jump_if_false SNAKESPAWN02D
03C0: @0 = actor $PLAYER_ACTOR car
0441: $QSPAWNID3 = car @0 model
0002: jump SNAKESPAWN00

:SNAKESPAWN02D
00D6: if  2
00E1:   key_pressed  0  4 ;; weapon2
00E1:   key_pressed  0  6 ;; handbrake
00E1:   key_pressed  0  8 ;; next radio station
004D: jump_if_false SNAKESPAWN00
03C0: @0 = actor $PLAYER_ACTOR car
0441: $QSPAWNID4 = car @0 model
0002: jump SNAKESPAWN00

:SNAKESPAWN03
00D6: if  1
8449:   NOT   actor $PLAYER_ACTOR in_a_car
80DF:   NOT   actor $PLAYER_ACTOR driving
004D: jump_if_false SNAKESPAWN00
00D6: if  2
00E1:   key_pressed  0  4 ;; action
00E1:   key_pressed  0  5 ;; prev weapon
80E1:   NOT   key_pressed  0  6 ;; aim
004D: jump_if_false SNAKESPAWN03B
0084: $SNAKE_CSID = $QSPAWNID1  ;; integer values and handles
0002: jump SNAKESPAWN01D

:SNAKESPAWN03B
00D6: if  2
00E1:   key_pressed  0  4 ;; action
00E1:   key_pressed  0  7 ;; next weapon
80E1:   NOT   key_pressed  0  6 ;; aim
004D: jump_if_false SNAKESPAWN03C
0084: $SNAKE_CSID = $QSPAWNID2  ;; integer values and handles
0002: jump SNAKESPAWN01D

:SNAKESPAWN03C
00D6: if  1
00E1:   key_pressed  0  4 ;; action
00E1:   key_pressed  0  8 ;; group forward
004D: jump_if_false SNAKESPAWN03D
0084: $SNAKE_CSID = $QSPAWNID3  ;; integer values and handles
0002: jump SNAKESPAWN01D

:SNAKESPAWN03D
00D6: if  1
00E1:   key_pressed  0  4 ;; action
00E1:   key_pressed  0  9 ;; group back
004D: jump_if_false SNAKESPAWN00
0084: $SNAKE_CSID = $QSPAWNID4  ;; integer values and handles
0002: jump SNAKESPAWN01D
