// BOOTCAMP SCRIPT v1.00 by Pyro, 2010
// Capture the Vehicle Script

/* GENERAL NOTES...
Angles for most things:
N: 180, NE: 135, E: 90, SE: 45, S: 0, SW: 315, W: 270, NW: 225

For phones:
N: 270 E: 180 S: 90 W: 0
*/

// Declare players...
  // Non-host team in 3 and 5 player matches receives the extra player
PLAYER_PED p1 = ( 102.5 , 120.5 , 2.0 ) 10 180 // Team 1 - red
PLAYER_PED p2 = ( 107.0 , 81.5 , 2.0 ) 7 0 // Team 2 - yellow
PLAYER_PED p4 = ( 102.5 , 81.5 , 2.0 ) 7 0 // Team 2 - yellow
PLAYER_PED p3 = ( 107.5 , 120.5 , 2.0 ) 10 180 // Team 1 - red
PLAYER_PED p6 = ( 105.0 , 81.5 , 2.0 ) 7 0 // Team 2 - yellow
PLAYER_PED p5 = ( 105.0 , 120.5 , 2.0 ) 10 180 // Team 1 0 red

// Generic objects...
OBJ_DATA cone01 = ( 112.7 , 105.3 , 2.0 ) 0 CONE
OBJ_DATA cone02 = ( 112.7 , 105.7 , 2.0 ) 0 CONE
OBJ_DATA cone03 = ( 112.7 , 106.3 , 2.0 ) 0 CONE
OBJ_DATA cone04 = ( 112.7 , 106.7 , 2.0 ) 0 CONE
OBJ_DATA bollard01 = ( 103.5 , 109.1 , 2.0 ) 180 BOLLARD
OBJ_DATA bollard02 = ( 103.9 , 109.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard03 = ( 103.1 , 109.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard04 = ( 106.5 , 109.1 , 2.0 ) 180 BOLLARD
OBJ_DATA bollard05 = ( 106.9 , 109.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard06 = ( 106.1 , 109.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard07 = ( 103.5 , 92.9 , 2.0 ) 180 BOLLARD
OBJ_DATA bollard08 = ( 103.9 , 92.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard09 = ( 103.1 , 92.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard10 = ( 106.5 , 92.9 , 2.0 ) 180 BOLLARD
OBJ_DATA bollard11 = ( 106.9 , 92.5 , 2.0 ) 90 BOLLARD
OBJ_DATA bollard12 = ( 106.1 , 92.5 , 2.0 ) 90 BOLLARD
OBJ_DATA roadblock01 = ( 116.2 , 105.5 , 2.0 ) 90 ROADBLOCK
OBJ_DATA roadblock02 = ( 116.2 , 106.5 , 2.0 ) 90 ROADBLOCK
OBJ_DATA roadblock03 = ( 116.2 , 107.5 , 2.0 ) 90 ROADBLOCK
OBJ_DATA roadblock04 = ( 116.2 , 108.5 , 2.0 ) 90 ROADBLOCK
OBJ_DATA tyre01 = ( 111.5 , 103.5 , 2.0 ) 0 TYRE
OBJ_DATA tyre02 = ( 111.6 , 103.7 , 2.0 ) 0 TYRE
OBJ_DATA tyre03 = ( 103.2 , 96.2 , 2.0 ) 0 TYRE
OBJ_DATA tyre04 = ( 103.5 , 96.5 , 2.0 ) 0 TYRE
OBJ_DATA tyre05 = ( 111.8 , 93.2 , 2.0 ) 0 TYRE
OBJ_DATA oilbarrel01 = ( 97.2 , 110.8 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel02 = ( 97.2 , 110.5 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel03 = ( 97.5 , 110.8 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel04 = ( 99.5 , 102.5 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel05 = ( 99.8 , 102.8 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel06 = ( 99.8 , 94.2 , 2.0 ) 0 OILDRUM
OBJ_DATA oilbarrel07 = ( 99.5 , 94.6 , 2.0 ) 0 OILDRUM
OBJ_DATA tower01 = ( 99.8 , 105.8 , 4.0 ) 0 TOWER
			// Base generators
OBJ_DATA generator01 = ( 103.5 , 112.5 , 4.0 ) 0 POWERGEN
OBJ_DATA generator02 = ( 106.5 , 112.5 , 4.0 ) 0 POWERGEN
OBJ_DATA generator03 = ( 103.5 , 89.5 , 4.0 ) 0 POWERGEN
OBJ_DATA generator04 = ( 106.5 , 89.5 , 4.0 ) 0 POWERGEN

// Sounds...
			// Generator sounds in the bases - can be removed in DESTRUCTION after blowing up stuff
SOUND generatornoise01
SOUND generatornoise02
SOUND generatornoise03
SOUND generatornoise04
SOUND fan01
SOUND fan02
SOUND fan03
SOUND fan04
SOUND fan05
SOUND fan06
SOUND vat01
SOUND waterfall01
SOUND grass01
SOUND grass02
SOUND grass03
SOUND grass04
SOUND team_1_apc_stolen_alarm
SOUND team_2_apc_stolen_alarm

// Vehicles...
CAR_DATA jeep01
CAR_DATA jeep02
CAR_DATA jeep03
CAR_DATA jeep04
CAR_DATA jeep05
CAR_DATA jeep06
CAR_DATA jeep07
CAR_DATA jeep08
CAR_DATA tank01
CAR_DATA tank02
CAR_DATA p1_current_car
CAR_DATA team_1_vehicle // used for Capture the Vehicle - use APC
CAR_DATA team_2_vehicle // used for Capture the Vehicle - use APC
PARKED_CAR_DATA trailer01 = ( 118.5 , 106.5 , 2.0 ) 23 0 TRUKTRNS // Used for removing destroyed APC's in spawn area
PARKED_CAR_DATA trailer02 = ( 120.5 , 106.5 , 2.0 ) 23 0 TRUKTRNS // Used for removing destroyed APC's in spawn area
PARKED_CAR_DATA truck01 = ( 102.5 , 99.5 , 2.0 ) 23 180 BOXTRUCK
PARKED_CAR_DATA truck02 = ( 107.5 , 102.5 , 2.0 ) 23 0 BOXTRUCK
PARKED_CAR_DATA car01 = ( 98.5 , 100.5 , 2.0 ) 23 180 BUICK
PARKED_CAR_DATA car02 = ( 111.5 , 101.5 , 2.0 ) 23 0 BUICK
PARKED_CAR_DATA van01 = ( 105.0 , 103.0 , 2.0 ) 23 0 VAN
PARKED_CAR_DATA van02 = ( 105.0 , 99.0 , 2.0 ) 23 180 VAN

// Weapon, health and armour generators... '120' cycles = 1 second
			// The bases
GENERATOR health01 = ( 100.5 , 116.5 , 2.0 ) 0 COLLECT_30 240 240
GENERATOR health02 = ( 109.5 , 116.5 , 2.0 ) 0 COLLECT_30 240 240
GENERATOR health03 = ( 109.5 , 85.5 , 2.0 ) 0 COLLECT_30 240 240
GENERATOR health04 = ( 100.5 , 85.5 , 2.0 ) 0 COLLECT_30 240 240
GENERATOR armour01 = ( 100.5 , 117.5 , 2.0 ) 0 COLLECT_31 240 240
GENERATOR armour02 = ( 109.5 , 117.5 , 2.0 ) 0 COLLECT_31 240 240
GENERATOR armour03 = ( 109.5 , 84.5 , 2.0 ) 0 COLLECT_31 240 240
GENERATOR armour04 = ( 100.5 , 84.5 , 2.0 ) 0 COLLECT_31 240 240
GENERATOR mg01 = ( 99.5 , 118.5 , 2.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg02 = ( 110.5 , 118.5 , 2.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg03 = ( 110.5 , 83.5 , 2.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg04 = ( 99.5 , 83.5 , 2.0 ) 0 COLLECT_01 0 0 99
GENERATOR molotov01 = ( 99.5 , 119.5 , 2.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov02 = ( 110.5 , 119.5 , 2.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov03 = ( 110.5 , 82.5 , 2.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov04 = ( 99.5 , 82.5 , 2.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov05 = ( 98.5 , 114.5 , 4.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov06 = ( 111.5 , 114.5 , 4.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov07 = ( 98.5 , 87.5 , 4.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov08 = ( 111.5 , 87.5 , 4.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov09 = ( 104.5 , 110.5 , 3.0 ) 0 COLLECT_04 0 0 99
GENERATOR molotov10 = ( 105.5 , 91.5 , 3.0 ) 0 COLLECT_04 0 0 99
GENERATOR rockets01 = ( 100.5 , 119.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR rockets02 = ( 109.5 , 119.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR rockets03 = ( 109.5 , 82.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR rockets04 = ( 100.5 , 82.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR flamer01 = ( 100.5 , 118.5 , 2.0 ) 0 COLLECT_08 0 0 99
GENERATOR flamer02 = ( 109.5 , 118.5 , 2.0 ) 0 COLLECT_08 0 0 99
GENERATOR flamer03 = ( 109.5 , 83.5 , 2.0 ) 0 COLLECT_08 0 0 99
GENERATOR flamer04 = ( 100.5 , 83.5 , 2.0 ) 0 COLLECT_08 0 0 99
GENERATOR electro01 = ( 101.5 , 110.5 , 4.0 ) 0 COLLECT_03 0 0 99
GENERATOR electro02 = ( 108.5 , 110.5 , 4.0 ) 0 COLLECT_03 0 0 99
GENERATOR electro03 = ( 108.5 , 91.5 , 4.0 ) 0 COLLECT_03 0 0 99
GENERATOR electro04 = ( 101.5 , 91.5 , 4.0 ) 0 COLLECT_03 0 0 99
GENERATOR vmg01 = ( 103.5 , 114.5 , 2.0 ) 0 COLLECT_18 0 0 99
GENERATOR vmg02 = ( 106.5 , 114.5 , 2.0 ) 0 COLLECT_18 0 0 99
GENERATOR vmg03 = ( 106.5 , 87.5 , 2.0 ) 0 COLLECT_18 0 0 99
GENERATOR vmg04 = ( 103.5 , 87.5 , 2.0 ) 0 COLLECT_18 0 0 99
GENERATOR smg01 = ( 105.5 , 110.5 , 3.0 ) 0 COLLECT_09 0 0 99
GENERATOR smg02 = ( 104.5 , 91.5 , 3.0 ) 0 COLLECT_09 0 0 99
GENERATOR dbldmg07 = ( 101.5 , 118.5 , 3.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg08 = ( 108.5 , 118.5 , 3.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg09 = ( 101.5 , 83.5 , 3.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg10 = ( 108.5 , 83.5 , 3.0 ) 0 COLLECT_35 600 600
GENERATOR rapidfire07 = ( 101.5 , 116.5 , 3.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire08 = ( 108.5 , 116.5 , 3.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire09 = ( 101.5 , 85.5 , 3.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire10 = ( 108.5 , 85.5 , 3.0 ) 0 COLLECT_36 600 600
			
			// No-man's land
GENERATOR rockets05 = ( 98.5 , 102.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR rockets06 = ( 111.5 , 99.5 , 2.0 ) 0 COLLECT_02 0 0 99
GENERATOR dbldmg01 = ( 97.5 , 102.5 , 2.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg02 = ( 112.5 , 99.5 , 2.0 ) 0 COLLECT_35 600 600
GENERATOR rapidfire01 = ( 97.5 , 101.5 , 2.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire02 = ( 112.5 , 100.5 , 2.0 ) 0 COLLECT_36 600 600
 // Respawn point weapons, armour and fast reload...
GENERATOR mg05 = ( 103.5 , 100.5 , 4.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg06 = ( 105.5 , 99.5 , 4.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg07 = ( 106.5 , 101.5 , 4.0 ) 0 COLLECT_01 0 0 99
GENERATOR mg08 = ( 104.5 , 102.5 , 4.0 ) 0 COLLECT_01 0 0 99
GENERATOR armour05 = ( 103.5 , 100.5 , 4.0 ) 0 COLLECT_31 240 240
GENERATOR armour06 = ( 105.5 , 99.5 , 4.0 ) 0 COLLECT_31 240 240
GENERATOR armour07 = ( 106.5 , 101.5 , 4.0 ) 0 COLLECT_31 240 240
GENERATOR armour08 = ( 104.5 , 102.5 , 4.0 ) 0 COLLECT_31 240 240
GENERATOR rapidfire03 = ( 103.5 , 101.5 , 4.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire04 = ( 104.5 , 99.5 , 4.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire05 = ( 106.5 , 100.5 , 4.0 ) 0 COLLECT_36 600 600
GENERATOR rapidfire06 = ( 105.5 , 102.5 , 4.0 ) 0 COLLECT_36 600 600
GENERATOR dbldmg03 = ( 103.5 , 101.5 , 4.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg04 = ( 104.5 , 99.5 , 4.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg05 = ( 106.5 , 100.5 , 4.0 ) 0 COLLECT_35 600 600
GENERATOR dbldmg06 = ( 105.5 , 102.5 , 4.0 ) 0 COLLECT_35 600 600
  // End of respawn weapons
GENERATOR mines01 = ( 105.0 , 104.5 , 2.0 ) 0 COLLECT_17 7200 7200 5
GENERATOR mines02 = ( 105.0 , 97.5 , 2.0 ) 0 COLLECT_17 7200 7200 5

// Fun generators hidden in ventilation shafts in the bases...
GENERATOR invuln01 = ( 113.5 , 112.5 , 3.0 ) 0 COLLECT_34 7200 7200
GENERATOR invuln02 = ( 96.5 , 89.5 , 3.0 ) 0 COLLECT_34 7200 7200

// Cranes
			// Scenic crane to east of map, does nothing other than to look pretty...
CRANE_DATA dockcrane01 = ( 114.5 , 103.5 ) 315 NO_HOMECRANE
CRANE_DATA dockcrane02 = ( 97.5 , 104.5 ) 290 NO_HOMECRANE

// Arrows...
ARROW_DATA arrow01 // always points to Team 1's APC
ARROW_DATA arrow02 // always points to Team 2's APC
//ARROW_DATA arrow03 // will point to Team 1's garage when in Team 2's APC
//ARROW_DATA arrow04 // will point to Team 2's garage when in Team 1's APC

// Display counters to show team scores...
ONSCREEN_COUNTER team_1_score_counter
ONSCREEN_COUNTER team_2_score_counter

// Declarations...
DECLARE_DOOR_INFO ( 56 , 63 , 2 ) // Start tile, end tile and speed
DECLARE_DOOR_INFO ( 969 , 976 , 2 ) // SRS style door

// Doors
DOOR_DATA team_1_door = DOUBLE ( 101 , 113 , 2 ) ( 101.0 , 114.0 , 2.0 , 2.0 , 4.0 ) BOTTOM 0 ANY_PLAYER_ONE_CAR CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED
DOOR_DATA team_2_door = DOUBLE ( 108 , 88 , 2 ) ( 109.0 , 88.0 , 2.0 , 2.0 , 4.0 ) TOP 1 ANY_PLAYER_ONE_CAR CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED

// Counters...
COUNTER loop = 1
COUNTER team_1_score = 0
COUNTER team_2_score = 0
COUNTER p1_in_team2_car = 0
COUNTER p2_in_team1_car = 0
COUNTER p3_in_team2_car = 0
COUNTER p4_in_team1_car = 0
COUNTER p5_in_team2_car = 0
COUNTER p6_in_team1_car = 0
COUNTER team_1_vehicle_parked = 0
COUNTER team_2_vehicle_parked = 0
COUNTER winner = 0

// Level start!!
LEVELSTART

SET_AMBIENT_LEVEL ( 0.33 , 0 )

team_1_vehicle = CREATE_CAR ( 105.0 , 119.3 , 2.0 ) -1 180 APC END
team_2_vehicle = CREATE_CAR ( 105.0 , 82.7 , 2.0 ) -1 0 APC END

// Arrow pointing at start of the game...
POINT_ARROW_AT ( arrow01 , team_1_vehicle )
POINT_ARROW_AT ( arrow02 , team_2_vehicle )
SET_ARROW_COLOUR ( arrow01 , RED ) // Team 1 arrow - always points to Team 1's APC
SET_ARROW_COLOUR ( arrow02 , YELLOW ) // Team 2 arrow - always points to Team 2's APC

// Create vehicles, give them weapons and will be used to respawn them later on...
jeep01 = CREATE_CAR ( 104.5 , 116.5 , 2.0 ) -1 180 GUNJEEP END
jeep02 = CREATE_CAR ( 104.5 , 117.5 , 2.0 ) -1 0 GUNJEEP END
jeep03 = CREATE_CAR ( 105.5 , 116.5 , 2.0 ) -1 180 GUNJEEP END
jeep04 = CREATE_CAR ( 105.5 , 117.5 , 2.0 ) -1 0 GUNJEEP END
jeep05 = CREATE_CAR ( 104.5 , 85.5 , 2.0 ) -1 0 GUNJEEP END
jeep06 = CREATE_CAR ( 104.5 , 84.5 , 2.0 ) -1 180 GUNJEEP END
jeep07 = CREATE_CAR ( 105.5 , 85.5 , 2.0 ) -1 0 GUNJEEP END
jeep08 = CREATE_CAR ( 105.5 , 84.5 , 2.0 ) -1 180 GUNJEEP END
tank01 = CREATE_CAR ( 98.5 , 106.5 , 2.0 ) -1 90 TANK END
tank02 = CREATE_CAR ( 111.5 , 95.5 , 2.0 ) -1 270 TANK END

			// Create sounds declared above...
generatornoise01 = CREATE_SOUND ( 103.5 , 112.5 , 4.0 ) GENERATOR_RUMBLE PLAY_FOREVER END
generatornoise02 = CREATE_SOUND ( 106.5 , 112.5 , 4.0 ) GENERATOR_RUMBLE PLAY_FOREVER END
generatornoise03 = CREATE_SOUND ( 103.5 , 89.5 , 4.0 ) GENERATOR_RUMBLE PLAY_FOREVER END
generatornoise04 = CREATE_SOUND ( 106.5 , 89.5 , 4.0 ) GENERATOR_RUMBLE PLAY_FOREVER END
fan01 = CREATE_SOUND ( 102.5 , 114.5 , 3.0 ) FAN_NOISE PLAY_FOREVER END
fan02 = CREATE_SOUND ( 107.5 , 114.5 , 3.0 ) FAN_NOISE PLAY_FOREVER END
fan03 = CREATE_SOUND ( 102.5 , 87.5 , 3.0 ) FAN_NOISE PLAY_FOREVER END
fan04 = CREATE_SOUND ( 107.5 , 87.5 , 3.0 ) FAN_NOISE PLAY_FOREVER END
fan05 = CREATE_SOUND ( 107.5 , 107.5 , 3.0 ) FAN_NOISE PLAY_FOREVER END
fan06 = CREATE_SOUND ( 105.0 , 101.0 , 5.0 ) FAN_NOISE PLAY_FOREVER END
vat01 = CREATE_SOUND ( 100.5 , 94.5 , 5.0 ) VAT PLAY_FOREVER END
waterfall01 = CREATE_SOUND ( 105.0 , 125.3 , 2.0 ) WATERFALL PLAY_FOREVER END
grass01 = CREATE_SOUND ( 97.5 , 78.5 , 5.0 ) CRICKETS PLAY_FOREVER END
grass02 = CREATE_SOUND ( 104.5 , 76.5 , 5.0 ) CRICKETS PLAY_FOREVER END
grass03 = CREATE_SOUND ( 112.5 , 77.5 , 5.0 ) CRICKETS PLAY_FOREVER END
grass04 = CREATE_SOUND ( 117.5 , 82.5 , 5.0 ) CRICKETS PLAY_FOREVER END

// Give vehicle weapons... defaut is +50 so needs to be used twice to get 99 rounds
GIVE_WEAPON ( jeep01 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep01 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep02 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep02 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep03 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep03 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep04 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep04 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep05 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep05 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep06 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep06 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep07 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep07 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep08 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep08 , CAR_MACHINE_GUN )
GIVE_WEAPON ( jeep01 , JEEP_GUN )
GIVE_WEAPON ( jeep01 , JEEP_GUN )
GIVE_WEAPON ( jeep02 , JEEP_GUN )
GIVE_WEAPON ( jeep02 , JEEP_GUN )
GIVE_WEAPON ( jeep03 , JEEP_GUN )
GIVE_WEAPON ( jeep03 , JEEP_GUN )
GIVE_WEAPON ( jeep04 , JEEP_GUN )
GIVE_WEAPON ( jeep04 , JEEP_GUN )
GIVE_WEAPON ( jeep05 , JEEP_GUN )
GIVE_WEAPON ( jeep05 , JEEP_GUN )
GIVE_WEAPON ( jeep06 , JEEP_GUN )
GIVE_WEAPON ( jeep06 , JEEP_GUN )
GIVE_WEAPON ( jeep07 , JEEP_GUN )
GIVE_WEAPON ( jeep07 , JEEP_GUN )
GIVE_WEAPON ( jeep08 , JEEP_GUN )
GIVE_WEAPON ( jeep08 , JEEP_GUN )
GIVE_WEAPON ( tank01 , CAR_MACHINE_GUN )
GIVE_WEAPON ( tank01 , CAR_MACHINE_GUN )
GIVE_WEAPON ( tank02 , CAR_MACHINE_GUN )
GIVE_WEAPON ( tank02 , CAR_MACHINE_GUN )
GIVE_WEAPON ( tank01 , TANK_GUN )
GIVE_WEAPON ( tank01 , TANK_GUN )
GIVE_WEAPON ( tank02 , TANK_GUN )
GIVE_WEAPON ( tank02 , TANK_GUN )

// Display the on-screen counters to record team scores...
ADD_ONSCREEN_COUNTER ( team_1_score_counter , team_1_score )
ADD_ONSCREEN_COUNTER ( team_2_score_counter , team_2_score )

// Switch generators ON...
SWITCH_GENERATOR ( health01 , ON )
SWITCH_GENERATOR ( health02 , ON )
SWITCH_GENERATOR ( health03 , ON )
SWITCH_GENERATOR ( health04 , ON )
SWITCH_GENERATOR ( armour01 , ON )
SWITCH_GENERATOR ( armour02 , ON )
SWITCH_GENERATOR ( armour03 , ON )
SWITCH_GENERATOR ( armour04 , ON )
SWITCH_GENERATOR ( armour05 , ON )
SWITCH_GENERATOR ( armour06 , ON )
SWITCH_GENERATOR ( armour07 , ON )
SWITCH_GENERATOR ( armour08 , ON )
SWITCH_GENERATOR ( mg01 , ON )
SWITCH_GENERATOR ( mg02 , ON )
SWITCH_GENERATOR ( mg03 , ON )
SWITCH_GENERATOR ( mg04 , ON )
SWITCH_GENERATOR ( mg05 , ON )
SWITCH_GENERATOR ( mg06 , ON )
SWITCH_GENERATOR ( mg07 , ON )
SWITCH_GENERATOR ( mg08 , ON )
SWITCH_GENERATOR ( smg01 , ON )
SWITCH_GENERATOR ( smg02 , ON )
SWITCH_GENERATOR ( rockets01 , ON )
SWITCH_GENERATOR ( rockets02 , ON )
SWITCH_GENERATOR ( rockets03 , ON )
SWITCH_GENERATOR ( rockets04 , ON )
SWITCH_GENERATOR ( rockets05 , ON )
SWITCH_GENERATOR ( rockets06 , ON )
SWITCH_GENERATOR ( flamer01 , ON )
SWITCH_GENERATOR ( flamer02 , ON )
SWITCH_GENERATOR ( flamer03 , ON )
SWITCH_GENERATOR ( flamer04 , ON )
SWITCH_GENERATOR ( electro01 , ON )
SWITCH_GENERATOR ( electro02 , ON )
SWITCH_GENERATOR ( electro03 , ON )
SWITCH_GENERATOR ( electro04 , ON )
SWITCH_GENERATOR ( vmg01 , ON )
SWITCH_GENERATOR ( vmg02 , ON )
SWITCH_GENERATOR ( vmg03 , ON )
SWITCH_GENERATOR ( vmg04 , ON )
SWITCH_GENERATOR ( dbldmg01 , ON )
SWITCH_GENERATOR ( dbldmg02 , ON )
SWITCH_GENERATOR ( dbldmg03 , ON )
SWITCH_GENERATOR ( dbldmg04 , ON )
SWITCH_GENERATOR ( dbldmg05 , ON )
SWITCH_GENERATOR ( dbldmg06 , ON )
SWITCH_GENERATOR ( dbldmg07 , ON )
SWITCH_GENERATOR ( dbldmg08 , ON )
SWITCH_GENERATOR ( dbldmg09 , ON )
SWITCH_GENERATOR ( dbldmg10 , ON )
SWITCH_GENERATOR ( rapidfire01 , ON )
SWITCH_GENERATOR ( rapidfire02 , ON )
SWITCH_GENERATOR ( rapidfire03 , ON )
SWITCH_GENERATOR ( rapidfire04 , ON )
SWITCH_GENERATOR ( rapidfire05 , ON )
SWITCH_GENERATOR ( rapidfire06 , ON )
SWITCH_GENERATOR ( rapidfire07 , ON )
SWITCH_GENERATOR ( rapidfire08 , ON )
SWITCH_GENERATOR ( rapidfire09 , ON )
SWITCH_GENERATOR ( rapidfire10 , ON )
SWITCH_GENERATOR ( mines01 , ON )
SWITCH_GENERATOR ( mines02 , ON )
SWITCH_GENERATOR ( invuln01 , ON )
SWITCH_GENERATOR ( invuln02 , ON )
SWITCH_GENERATOR ( molotov01 , ON )
SWITCH_GENERATOR ( molotov02 , ON )
SWITCH_GENERATOR ( molotov03 , ON )
SWITCH_GENERATOR ( molotov04 , ON )
SWITCH_GENERATOR ( molotov05 , ON )
SWITCH_GENERATOR ( molotov06 , ON )
SWITCH_GENERATOR ( molotov07 , ON )
SWITCH_GENERATOR ( molotov08 , ON )
SWITCH_GENERATOR ( molotov09 , ON )
SWITCH_GENERATOR ( molotov10 , ON )

// Door operation...
MAKE_DOOR_MANUAL ( team_1_door ) // Use "UPDATE_DOOR_TARGET ( door_name , car_name )" when manually selecting car to enter
MAKE_DOOR_MANUAL ( team_2_door ) // See "bil_ze2.mis" file for garage example for car and parking... useful for scores!

// Set trailers everything proof...
SET_CAR_BULLETPROOF ( trailer01 , ON )
SET_CAR_ROCKETPROOF ( trailer01 , ON )
SET_CAR_FLAMEPROOF ( trailer01 , ON )
SET_CAR_BULLETPROOF ( trailer02 , ON )
SET_CAR_ROCKETPROOF ( trailer02 , ON )
SET_CAR_FLAMEPROOF ( trailer02 , ON )

WHILE_EXEC ( loop = 1 )

// Check to see if Team 1's APC is destroyed and respawn it...
IF ( IS_CAR_WRECKED ( team_1_vehicle ) )
REMOVE_ARROW ( arrow01 )
SET p2_in_team1_car = 0
SET p4_in_team1_car = 0
SET p6_in_team1_car = 0
SET team_1_vehicle_parked = 0
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.0 , 119.3 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( team_1_vehicle , 105.0 , 119.3 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( team_1_vehicle , trailer01 )
      ENDIF
      
				DELETE_ITEM ( team_1_vehicle )
    team_1_vehicle = CREATE_CAR ( 105.0 , 119.3 , 2.0 ) -1 180 APC END
    POINT_ARROW_AT ( arrow01 , team_1_vehicle )
    ENDIF
  ENDIF
ENDIF

// Check to see if Team 2's APC is destroyed and respawn it...
IF ( IS_CAR_WRECKED ( team_2_vehicle ) )
REMOVE_ARROW ( arrow02 )
SET p1_in_team2_car = 0
SET p3_in_team2_car = 0
SET p5_in_team2_car = 0
SET team_2_vehicle_parked = 0
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.0 , 82.7 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( team_2_vehicle , 105.0 , 82.7 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( team_2_vehicle , trailer02 )
      ENDIF
      
				DELETE_ITEM ( team_2_vehicle )
    team_2_vehicle = CREATE_CAR ( 105.0 , 82.7 , 2.0 ) -1 0 APC END
    POINT_ARROW_AT ( arrow02 , team_2_vehicle )
    ENDIF
  ENDIF
ENDIF

// Respawn vehicle scripts for generic vehicles (jeeps/tanks)...
  // Tanks
IF ( IS_CAR_WRECKED ( tank01 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 98.5 , 106.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( tank01 , 98.5 , 106.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( tank01 , trailer01 )
      ENDIF
    DELETE_ITEM ( tank01 )
    tank01 = CREATE_CAR ( 98.5 , 106.5 , 2.0 ) -1 90 TANK END
    GIVE_WEAPON ( tank01 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( tank01 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( tank01 , TANK_GUN )
    GIVE_WEAPON ( tank01 , TANK_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( tank02 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 111.5 , 95.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( tank02 , 111.5 , 95.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( tank02 , trailer02 )
      ENDIF
    DELETE_ITEM ( tank02 )
    tank02 = CREATE_CAR ( 111.5 , 95.5 , 2.0 ) -1 270 TANK END
    GIVE_WEAPON ( tank02 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( tank02 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( tank02 , TANK_GUN )
    GIVE_WEAPON ( tank02 , TANK_GUN )
    ENDIF
  ENDIF
ENDIF

  // Jeeps...
IF ( IS_CAR_WRECKED ( jeep01 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 104.5 , 116.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep01 , 104.5 , 116.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep01 , trailer01 )
      ENDIF
    DELETE_ITEM ( jeep01 )
    jeep01 = CREATE_CAR ( 104.5 , 116.5 , 2.0 ) -1 180 GUNJEEP END
    GIVE_WEAPON ( jeep01 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep01 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep01 , JEEP_GUN )
    GIVE_WEAPON ( jeep01 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep02 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 104.5 , 117.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep02 , 104.5 , 117.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep02 , trailer01 )
      ENDIF
    DELETE_ITEM ( jeep02 )
    jeep02 = CREATE_CAR ( 104.5 , 117.5 , 2.0 ) -1 0 GUNJEEP END
    GIVE_WEAPON ( jeep02 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep02 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep02 , JEEP_GUN )
    GIVE_WEAPON ( jeep02 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep03 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.5 , 116.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep03 , 105.5 , 116.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep03 , trailer01 )
      ENDIF
    DELETE_ITEM ( jeep03 )
    jeep03 = CREATE_CAR ( 105.5 , 116.5 , 2.0 ) -1 180 GUNJEEP END
    GIVE_WEAPON ( jeep03 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep03 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep03 , JEEP_GUN )
    GIVE_WEAPON ( jeep03 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep04 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.5 , 117.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep04 , 105.5 , 117.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep04 , trailer01 )
      ENDIF
    DELETE_ITEM ( jeep04 )
    jeep04 = CREATE_CAR ( 105.5 , 117.5 , 2.0 ) -1 0 GUNJEEP END
    GIVE_WEAPON ( jeep04 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep04 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep04 , JEEP_GUN )
    GIVE_WEAPON ( jeep04 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep05 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 104.5 , 85.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep05 , 104.5 , 85.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep05 , trailer02 )
      ENDIF
    DELETE_ITEM ( jeep05 )
    jeep05 = CREATE_CAR ( 104.5 , 85.5 , 2.0 ) -1 0 GUNJEEP END
    GIVE_WEAPON ( jeep05 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep05 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep05 , JEEP_GUN )
    GIVE_WEAPON ( jeep05 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep06 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 104.5 , 84.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep06 , 104.5 , 84.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep06 , trailer02 )
      ENDIF
    DELETE_ITEM ( jeep06 )
    jeep06 = CREATE_CAR ( 104.5 , 84.5 , 2.0 ) -1 180 GUNJEEP END
    GIVE_WEAPON ( jeep06 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep06 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep06 , JEEP_GUN )
    GIVE_WEAPON ( jeep06 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep07 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.5 , 85.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep07 , 105.5 , 85.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep07 , trailer02 )
      ENDIF
    DELETE_ITEM ( jeep07 )
    jeep07 = CREATE_CAR ( 105.5 , 85.5 , 2.0 ) -1 0 GUNJEEP END
    GIVE_WEAPON ( jeep07 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep07 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep07 , JEEP_GUN )
    GIVE_WEAPON ( jeep07 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF

IF ( IS_CAR_WRECKED ( jeep08 ) )
  IF ( NOT ( DELAY ( 100 ) ) )
    IF ( NOT ( IS_POINT_ONSCREEN ( 105.5 , 84.5 , 2.0 ) ) )
      IF ( IS_CAR_IN_BLOCK ( jeep08 , 105.5 , 84.5 , 2.0 , 1.0 , 1.0 ) )
      PUT_CAR_ON_TRAILER ( jeep08 , trailer02 )
      ENDIF
    DELETE_ITEM ( jeep08 )
    jeep08 = CREATE_CAR ( 105.5 , 84.5 , 2.0 ) -1 180 GUNJEEP END
    GIVE_WEAPON ( jeep08 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep08 , CAR_MACHINE_GUN )
    GIVE_WEAPON ( jeep08 , JEEP_GUN )
    GIVE_WEAPON ( jeep08 , JEEP_GUN )
    ENDIF
  ENDIF
ENDIF
// END OF RESPAWNING VEHICLE CODE...

// TEAM 1 STEALING TEAM 2's APC
// P1 stealing Team 2's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p1 , team_2_vehicle ) )
AND ( p1_in_team2_car = 0 ) )
				SET p1_in_team2_car = 1
				UPDATE_DOOR_TARGET ( team_1_door , team_2_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_1_door )
ENDIF

// P3 stealing Team 2's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p3 , team_2_vehicle ) )
AND ( p3_in_team2_car = 0 ) )
				SET p3_in_team2_car = 1
				UPDATE_DOOR_TARGET ( team_1_door , team_2_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_1_door )
ENDIF

// P5 stealing Team 2's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p5 , team_2_vehicle ) )
AND ( p5_in_team2_car = 0 ) )
				SET p5_in_team2_car = 1
				UPDATE_DOOR_TARGET ( team_1_door , team_2_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_1_door )
ENDIF

// TEAM 2 STEALING TEAM 1's APC
// P2 stealing Team 1's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p2 , team_1_vehicle ) )
AND ( p2_in_team1_car = 0 ) )
				SET p2_in_team1_car = 1
				UPDATE_DOOR_TARGET ( team_2_door , team_1_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_2_door )
ENDIF

// P4 stealing Team 1's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p4 , team_1_vehicle ) )
AND ( p4_in_team1_car = 0 ) )
				SET p4_in_team1_car = 1
				UPDATE_DOOR_TARGET ( team_2_door , team_1_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_2_door )
ENDIF

// P6 stealing Team 1's APC...
IF ( ( IS_CHARACTER_IN_CAR ( p6 , team_1_vehicle ) )
AND ( p6_in_team1_car = 0 ) )
				SET p6_in_team1_car = 1
				UPDATE_DOOR_TARGET ( team_2_door , team_1_vehicle )
				MAKE_DOOR_AUTOMATIC ( team_2_door )
ENDIF

// TEAM 1 LEAVING APC
// P1 leaves Team 2's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p1 , team_2_vehicle ) ) )
AND ( p1_in_team2_car = 1 ) )
				SET p1_in_team2_car = 0
ENDIF

// P3 leaves Team 2's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p3 , team_2_vehicle ) ) )
AND ( p3_in_team2_car = 1 ) )
				SET p3_in_team2_car = 0
ENDIF

// P5 leaves Team 2's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p5 , team_2_vehicle ) ) )
AND ( p5_in_team2_car = 1 ) )
				SET p5_in_team2_car = 0
ENDIF

// TEAM 2 LEAVING APC
// P2 leaves Team 1's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p2 , team_1_vehicle ) ) )
AND ( p2_in_team1_car = 1 ) )
				SET p2_in_team1_car = 0
ENDIF

// P4 leaves Team 1's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p4 , team_1_vehicle ) ) )
AND ( p4_in_team1_car = 1 ) )
				SET p4_in_team1_car = 0
ENDIF

// P6 leaves Team 1's APC...
IF ( ( NOT ( IS_CHARACTER_IN_CAR ( p6 , team_1_vehicle ) ) )
AND ( p6_in_team1_car = 1 ) )
				SET p6_in_team1_car = 0
ENDIF

// Wait for Team 2's APC at Team 1's garage door...
IF ( ( IS_CAR_IN_BLOCK ( team_2_vehicle , 101.0 , 112.0 , 2.0 , 2.0 , 3.0 ) )
AND ( team_2_vehicle_parked = 0 ) )
				PARK ( team_2_vehicle , team_1_door )
				SET team_2_vehicle_parked = 1
ENDIF

// Wait for Team 1's APC at Team 2's garage door...
IF ( ( IS_CAR_IN_BLOCK ( team_1_vehicle , 109.0 , 89.0 , 2.0 , 2.0 , 3.0 ) )
AND ( team_1_vehicle_parked = 0 ) )
				PARK ( team_1_vehicle , team_2_door )
				SET team_1_vehicle_parked = 1
ENDIF

// Wait for Team 2's APC parking to finish in Team 1's garage...
IF ( ( team_2_vehicle_parked = 1 )
AND ( HAS_PARK_FINISHED ( ) ) )
				SET p1_in_team2_car = 0
				SET p3_in_team2_car = 0
				SET p5_in_team2_car = 0
				SET team_2_vehicle_parked = 0
				++ team_1_score
				team_2_vehicle = CREATE_CAR ( 105.0 , 82.7 , 2.0 ) -1 0 APC END
				POINT_ARROW_AT ( arrow02 , team_2_vehicle )
ENDIF

// Wait for Team 1's APC parking to finish in Team 2's garage...
IF ( ( team_1_vehicle_parked = 1 )
AND ( HAS_PARK_FINISHED ( ) ) )
				SET p2_in_team1_car = 0
				SET p4_in_team1_car = 0
				SET p6_in_team1_car = 0
				SET team_1_vehicle_parked = 0
				++ team_2_score
				team_1_vehicle = CREATE_CAR ( 105.0 , 119.3 , 2.0 ) -1 180 APC END
				POINT_ARROW_AT ( arrow01 , team_1_vehicle )
ENDIF

// Check for 3 points to win for Team 1, add $100,000 to complete game
IF ( ( team_1_score = 3 )
AND ( winner = 0 ) )
ADD_SCORE ( p1 , 100000 )
ADD_SCORE ( p3 , 100000 )
ADD_SCORE ( p5 , 100000 )
SET winner = 1
ENDIF

// Check for 3 points to win for Team 2, add $100,000 to complete game
IF ( ( team_2_score = 3 )
AND ( winner = 0 ) )
ADD_SCORE ( p2 , 100000 )
ADD_SCORE ( p4 , 100000 )
ADD_SCORE ( p6 , 100000 )
SET winner = 1
ENDIF

ENDWHILE

LEVELEND
