// Script by Rick

SET_AMBIENT_LEVEL (1.0, 0)
PLAYER_PED p1 = (118.50, 133.50, 3.50) 11 180 // loonie
PLAYER_PED p2 = (97.50, 113.50, 255.0) 13 90 // yakuza
PLAYER_PED p3 = (130.50, 162.50, 2.0) 12 180 // elvis
PLAYER_PED p4 = (111.50, 161.50, 3.0) 8 270 // zaibatsu
PLAYER_PED p5 = (121.2, 108.8, 255.0) 6 270 // redneck
PLAYER_PED p6 = (148.5, 168.5, 255.0) 24 90 // hulk

CHAR_DATA soldier_1 = (144.5, 139.4, 2.0) 1 180 CRIMINAL_TYPE2
CHAR_DATA soldier_2 = (144.5, 139.0, 2.0) 1 0 CRIMINAL_TYPE2
CHAR_DATA soldier_3 = (144.5, 139.5, 2.0) 1 180 CRIMINAL_TYPE2
CHAR_DATA busdriver = (144.5, 139.5, 2.0) 1 180 CRIMINAL_TYPE2

COUNTER mainloop = 1
COUNTER p1msg = 0
COUNTER p2msg = 0
COUNTER p3msg = 0
COUNTER p4msg = 0
COUNTER p5msg = 0
COUNTER p6msg = 0
COUNTER alarm = 0
COUNTER p1_trg_horn = 0
COUNTER p2_trg_horn = 0
COUNTER p3_trg_horn = 0
COUNTER p4_trg_horn = 0
COUNTER p5_trg_horn = 0
COUNTER p6_trg_horn = 0

DECLARE_POLICELEVEL (1)
RADIO_STATION radio1 = STATION_KRISHNA (103.7, 97.9)
RADIO_STATION radio2 = STATION_RUSSIAN (79.3, 101.0)
RADIO_STATION radio3 = STATION_ZAIBATSU (87.2, 97.9)
RADIO_STATION radio4 = STATION_INDUSTRIAL (116.6, 100.9)
CAR_DATA auto1 = (106.4, 165.0, 1.0) 1 180 JEEP
CAR_DATA auto2 = (104.2, 165.1, 1.0) 1 180 JEEP
CAR_DATA auto3 = (116.6, 132.6, 2.0) 1 20 JEEP
CAR_DATA auto4 = (105.2, 165.1, 1.0) 1 180 JEEP
CAR_DATA auto5 = (107.5, 165.0, 1.0) 1 180 JEEP
CAR_DATA auto6 = (108.5, 165.0, 1.0) 1 180 JEEP
CAR_DATA auto7 = (109.6, 165.0, 1.0) 1 180 JEEP
CAR_DATA auto8 = (121.3, 111.9) 1 0 JEEP
CAR_DATA auto9 = (106.6, 135.3) 1 180 JEEP
CAR_DATA auto10 = (125.4, 128.9, 2.0) 1 345 JEEP
CAR_DATA auto11 = (91.9, 113.3, 4.0) 1 90 GUNJEEP
CAR_DATA auto12 = (91.9, 112.4, 4.0) 1 90 GUNJEEP
CAR_DATA auto13 = (91.9, 111.4, 4.0) 1 90 JEEP
CAR_DATA auto14 = (91.9, 110.4, 4.0) 1 90 GUNJEEP
CAR_DATA auto15 = (91.9, 109.4, 4.0) 1 90 JEEP
CAR_DATA bus1 = (118.5, 147.5) 0 180 BUS
CAR_DATA tank1 = (141.0, 124.1, 2.0) 0 0 TANK
CAR_DATA tank2 = (137.0, 123.0, 2.0) 0 0 TANK
CAR_DATA auto16 = (144.0, 130.5) 0 239 APC
CAR_DATA auto17 = (144.5, 128.4, 2.0) 0 312 GUNJEEP
PARKED_CAR_DATA trailer = (100.0, 200.0, 2.0) 0 0 TRUKCONT
CAR_DATA train1 = (161.98, 163.48) 0 90 TRUKCONT
CAR_DATA train2 = (159.97, 163.48) 0 90 TRUKCONT
CAR_DATA train3 = (157.95, 163.48) 0 90 TRUKCONT
CAR_DATA train4 = (155.93, 163.48) 0 90 TRUKCONT
CAR_DATA train5 = (153.91, 163.48) 0 90 TRUKCONT
CAR_DATA train11 = (168.9, 154.41) 0 90 TANKER
CAR_DATA train12 = (166.84, 154.41) 0 90 TANKER
CAR_DATA train13 = (164.80, 154.41) 0 90 TANKER
CAR_DATA train14 = (162.77, 154.41) 0 90 TANKER
CAR_DATA train15 = (160.73, 154.41) 0 90 TANKER
CAR_DATA train16 = (158.7, 154.41) 0 90 TANKER
CAR_DATA train17 = (156.68, 154.41) 0 90 TANKER
CAR_DATA train18 = (154.66, 154.41) 0 90 TANKER
CAR_DATA train19 = (152.64, 154.41) 0 90 TANKER
CAR_DATA auto18 = (151.9, 164.4, 4.0) 1 90 JEEP
CAR_DATA auto19 = (151.9, 164.4, 4.0) 1 90 JEEP
CAR_DATA auto20 = (151.9, 164.4, 4.0) 1 90 JEEP
CAR_DATA auto21 = (151.9, 164.4, 4.0) 1 90 JEEP
CAR_DATA auto22 = (151.9, 164.4, 4.0) 1 90 JEEP

SOUND fan1 = (125.7, 164.5, 4.0) FAN_NOISE PLAY_FOREVER
SOUND fan2 = (125.7, 162.5, 4.0) FAN_NOISE PLAY_FOREVER
SOUND alarm1 = (144.9, 137.9, 2.0) PRISON_ALARM PLAY_INSTANT
SOUND alarm2 = (135.9, 125.9, 2.0) PRISON_ALARM PLAY_INSTANT

PARKED_CAR_DATA zivil1 = (148.8, 173.1) 19 85 MORGAN
PARKED_CAR_DATA zivil2 = (142.3, 170.1) 1 0 BMW
PARKED_CAR_DATA zivil3 = (142.3, 171.7) 2 180 FIAT
PARKED_CAR_DATA zivil4 = (148.8, 170.5) 5 90 TBIRD
PARKED_CAR_DATA zivil5 = (148.8, 174.3) 6 92 MERC
PARKED_CAR_DATA zivil6 = (149.5, 166.5) 6 90 HOTDOG
PARKED_CAR_DATA zivil7 = (148.8, 180.9) 8 95 BUG
PARKED_CAR_DATA cop1 = (148.7, 179.8) 0 90 COPCAR
PARKED_CAR_DATA cop2 = (148.8, 178.7) 0 275 COPCAR
PARKED_CAR_DATA cop3 = (135.9, 192.0) 0 110 COPCAR
PARKED_CAR_DATA cop4 = (140.0, 192.0) 0 260 COPCAR
PARKED_CAR_DATA medi1 = (139.7, 188.7, 2.0) 0 180 MEDICAR

OBJ_DATA bol_1 = (115.1, 163.5, 1.0) 270 BOLLARD
OBJ_DATA bol_2 = (93.2, 108.2) 0 BOLLARD
OBJ_DATA bol_3 = (94.1, 108.6) 270 BOLLARD
OBJ_DATA bol_4 = (92.9, 108.6) 270 BOLLARD
OBJ_DATA bol_5 = (93.8, 108.2) 0 BOLLARD
OBJ_DATA tow_1 = (137.75, 188.13, 2.0) 270 TOWER
OBJ_DATA tow_2 = (137.75, 188.39, 2.0) 270 TOWER
OBJ_DATA tow_3 = (137.75, 188.65, 2.0) 270 TOWER
OBJ_DATA tow_4 = (137.75, 188.87, 2.0) 270 TOWER
OBJ_DATA tow_5 = (137.98, 188.87, 2.0) 270 TOWER
OBJ_DATA tow_6 = (138.24, 188.87, 2.0) 270 TOWER
OBJ_DATA tow_7 = (138.24, 188.61, 2.0) 270 TOWER
OBJ_DATA tow_8 = (138.24, 188.35, 2.0) 270 TOWER
OBJ_DATA tow_9 = (138.24, 188.13, 2.0) 270 TOWER
OBJ_DATA tow_10 = (137.5, 189.5, 2.0) 270 TOWER
OBJ_DATA tow_11 = (134.8, 191.2, 2.0) 270 TOWER
OBJ_DATA tow_12 = (137.2, 191.2, 2.0) 270 TOWER
OBJ_DATA tow_13 = (138.8, 191.2, 2.0) 270 TOWER
OBJ_DATA tow_14 = (141.2, 191.2, 2.0) 270 TOWER
OBJ_DATA tow_15 = (146.82, 146.77, 2.0) 270 TOWER
OBJ_DATA tow_16 = (149.19, 146.76, 2.0) 270 TOWER
OBJ_DATA tow_17 = (139.5, 132.5, 2.0) 270 TOWER
OBJ_DATA tow_18 = (142.5, 132.5, 2.0) 270 TOWER

SET_GANG_INFO (tankgang, 4, machine_gun, machine_gun, flame_thrower, 2, 138.50, 128.50, 3.00, 0, MERC, 0)
//1busy, 2goodcar, 3badcar, 4 policecar, 5peddens,
//6mugger, 7carthief, 8elvis, 9gangchar, 10policemen, 11gangcar
//																				busy  goc   bc   pc  pd  md  ct ed  gp  pm  gcar
MAP_ZONE tankinfo = (1000,   00,  00,  00, 100, 0, 0, 0, 1000, 0, 1000)
//SET_GANG_INFO (civigang, 4, pistol, pistol, shotgun, 8, 140.50, 194.50, 3.00, 0, JEEP, 23)
//MAP_ZONE civibase = (1000, 300, 300, 0, 100, 0, 0, 0, 1000, 0)
//MAP_ZONE pedzone = (1000, 300, 300, 0, 100, 0, 0, 0, 0, 0, 100)
GENERATOR flamer1 = (122.70, 115.40) 0 COLLECT_08 6000 6000 25
GENERATOR flamer2 = (97.8, 112.6, 3.0) 0 COLLECT_08 6000 6000 25
GENERATOR rocket = (102.50, 117.50, 2.00) 0 COLLECT_02 6000 6000 10
GENERATOR mines = (113.50, 131.50, 1.06) 0 COLLECT_17 6000 6000 4
GENERATOR mgun1 = (129.5, 120.5, 2.0) 0 COLLECT_01 6000 6000 30
GENERATOR mgun2 = (131.50, 157.50) 0 COLLECT_01 6000 6000 30
GENERATOR mgun3 = (97.8, 110.6, 3.0) 0 COLLECT_01 6000 6000 30
GENERATOR mgun4 = (97.8, 111.1, 3.0) 0 COLLECT_01 6000 6000 30
GENERATOR caruzi1 = (103.9, 108.4) 0 COLLECT_18 8000 8000 10
GENERATOR caruzi2 = (106.5, 155.0) 0 COLLECT_18 800 800 8
GENERATOR gen7 = (128.50, 129.40) 0 COLLECT_00 6000 6000 40
GENERATOR armor1 = (103.5, 161.5) 0 COLLECT_31 6000 6000 3
GENERATOR armor2 = (95.4, 112.5, 3.0) 0 COLLECT_31 6000 6000 3
GENERATOR armor3 = (114.5, 127.5) 0 COLLECT_31 6000 6000 3
GENERATOR gen9egun = (129.5, 121.5, 2.0) 0 COLLECT_03 8000 8000 6
GENERATOR gen10 = (99.50, 111.50) 0 COLLECT_10 6000 6000 30
GENERATOR gen11 = (104.5, 160.5) 0 COLLECT_01 6000 6000 10
GENERATOR molly1 = (114.50, 131.50) 0 COLLECT_04 6000 6000 10
GENERATOR molly2 = (102.30, 114.60) 0 COLLECT_04 6000 6000 10
GENERATOR molly3 = (117.50, 111.50, 4.0) 0 COLLECT_04 6000 6000 10
GENERATOR molly4 = (103.5, 160.5) 0 COLLECT_04 6000 6000 10
GENERATOR molly5 = (128.0, 163.5) 0 COLLECT_04 6000 6000 10
GENERATOR instant = (94.5, 110.0) 0 COLLECT_40 6000 6000 2
GENERATOR shotgun1 = (108.5, 128.5) 0 COLLECT_06 6000 6000 12
GENERATOR shotgun2 = (97.8, 111.8, 3.0) 0 COLLECT_06 6000 6000 12
GENERATOR shotgun3 = (128.6, 111.5) 0 COLLECT_06 6000 6000 12
GENERATOR shotgun4 = (148.6, 171.4) 0 COLLECT_06 6000 6000 12
GENERATOR shotgun5 = (104.5, 156.5) 0 COLLECT_06 6000 6000 12
GENERATOR gen15 = (92.50, 176.50, 2.00) 0 COLLECT_00 6000 6000 40
GENERATOR grenade1 = (102.80, 114.20) 0 COLLECT_05 6000 6000 12
GENERATOR grenade2 = (117.50, 112.50) 0 COLLECT_05 6000 6000 12
GENERATOR oil = (120.10, 131.50) 0 COLLECT_16 6000 6000 6
GENERATOR heal1 = (128.40, 124.50) 0 COLLECT_30 6000 6000 3
GENERATOR heal2 = (138.8, 124.0, 2.0) 0 COLLECT_30 6000 6000 3
GENERATOR heal3 = (110.3, 135.5) 0 COLLECT_30 6000 6000 3
GENERATOR heal4 = (97.8, 109.9, 3.0) 0 COLLECT_30 6000 6000 3
GENERATOR doublefire1 = (125.5, 163.5, 4.0) 0 COLLECT_36 6000 6000 3
GENERATOR doublefire2 = (121.5, 107.5) 0 COLLECT_36 6000 6000 3
GENERATOR doubledam1 = (122.8, 163.5, 1.0) 0 COLLECT_35 6000 6000 3
GENERATOR doubledam2 = (122.5, 107.5) 0 COLLECT_35 6000 6000 3
GENERATOR elfinger = (120.5, 163.5, 1.0) 0 COLLECT_37 6000 6000 3

//LEVELSTART////////////////////////////////////////////////////////////////////////////////////////
LEVELSTART

ADD_SCORE (p1,100)
ADD_SCORE (p2,100)
ADD_SCORE (p3,100)
ADD_SCORE (p4,100)
ADD_SCORE (p5,100)
ADD_SCORE (p6,100)

PUT_CAR_ON_TRAILER (auto18, train1)
PUT_CAR_ON_TRAILER (auto19, train2)
PUT_CAR_ON_TRAILER (auto20, train3)
PUT_CAR_ON_TRAILER (auto21, train4)
PUT_CAR_ON_TRAILER (auto22, train5)

KILL_CHAR (soldier_1)
KILL_CHAR (soldier_2)
KILL_CHAR (soldier_3)
KILL_CHAR (busdriver)


SWITCH_GENERATOR (flamer1, ON)
SWITCH_GENERATOR (flamer2, ON)
SWITCH_GENERATOR (rocket, ON)
SWITCH_GENERATOR (mines, ON)
SWITCH_GENERATOR (mgun1, ON)
SWITCH_GENERATOR (mgun2, ON)
SWITCH_GENERATOR (mgun3, ON)
SWITCH_GENERATOR (mgun4, ON)
SWITCH_GENERATOR (caruzi1, ON)
SWITCH_GENERATOR (caruzi2, ON)
SWITCH_GENERATOR (gen7, ON)
SWITCH_GENERATOR (armor1, ON)
SWITCH_GENERATOR (armor2, ON)
SWITCH_GENERATOR (armor3, ON)
SWITCH_GENERATOR (gen9egun, ON)
SWITCH_GENERATOR (gen10, ON)
SWITCH_GENERATOR (gen11, ON)
SWITCH_GENERATOR (molly1, ON)
SWITCH_GENERATOR (molly2, ON)
SWITCH_GENERATOR (molly3, ON)
SWITCH_GENERATOR (molly4, ON)
SWITCH_GENERATOR (molly5, ON)
SWITCH_GENERATOR (instant, OFF)
SWITCH_GENERATOR (shotgun1, ON)
SWITCH_GENERATOR (shotgun2, ON)
SWITCH_GENERATOR (shotgun3, ON)
SWITCH_GENERATOR (shotgun4, ON)
SWITCH_GENERATOR (shotgun5, ON)
SWITCH_GENERATOR (gen15, ON)
SWITCH_GENERATOR (grenade1, ON)
SWITCH_GENERATOR (grenade2, ON)
SWITCH_GENERATOR (oil, ON)
SWITCH_GENERATOR (heal1, ON)
SWITCH_GENERATOR (heal2, ON)
SWITCH_GENERATOR (heal3, ON)
SWITCH_GENERATOR (heal4, ON)
SWITCH_GENERATOR (doublefire1, ON)
SWITCH_GENERATOR (doublefire2, ON)
SWITCH_GENERATOR (doubledam1, ON)
SWITCH_GENERATOR (doubledam2, ON)
SWITCH_GENERATOR (elfinger, ON)

SET_CAR_EMERG_LIGHTS (cop3, ON)
SET_CAR_EMERG_LIGHTS (cop4, ON)
SET_CAR_EMERG_LIGHTS (medi1, ON)
SET_CAR_BULLETPROOF (bus1, ON)
SET_CAR_ROCKETPROOF (bus1, ON)

//GIVE_WEAPON ( auto1 , CAR_MACHINE_GUN , 32 )
//GIVE_WEAPON ( auto2 , CAR_MACHINE_GUN , 33 )
//GIVE_WEAPON ( auto3 , CAR_MACHINE_GUN , 36 )
//GIVE_WEAPON ( auto4 , CAR_MACHINE_GUN , 18 )
//GIVE_WEAPON ( auto5 , CAR_MACHINE_GUN , 32 )
//GIVE_WEAPON ( auto6 , CAR_MACHINE_GUN , 66 )
//GIVE_WEAPON ( auto7 , CAR_MACHINE_GUN , 31 )
GIVE_WEAPON ( auto8 , CAR_MACHINE_GUN , 28 )
//GIVE_WEAPON ( auto9 , CAR_MACHINE_GUN , 36 )
//GIVE_WEAPON ( auto10 , CAR_MACHINE_GUN , 28 )
GIVE_WEAPON ( zivil6 , CAR_BOMB_INSTANT , 1 )

/*Soldier Guards
GIVE_WEAPON ( soldier_1 , PISTOL)
GIVE_WEAPON ( soldier_2 , PISTOL)
GIVE_WEAPON ( soldier_3 , ROCKET_LAUNCHER)
ADD_PATROL_POINT (soldier_1, 150.5, 148.5, 2.0)
ADD_PATROL_POINT (soldier_1, 145.5, 148.5, 2.0)
ADD_PATROL_POINT (soldier_2, 145.5, 147.5, 2.0)
ADD_PATROL_POINT (soldier_2, 150.5, 147.5, 2.0)
ADD_PATROL_POINT (soldier_3, 142.5, 129.5, 2.0)
ADD_PATROL_POINT (soldier_3, 145.5, 129.5, 2.0)
SET_CHAR_SHOOTING_SKILL ( soldier_1 , CRACK_SHOT )
SET_CHAR_SHOOTING_SKILL ( soldier_2 , CRACK_SHOT )
SET_CHAR_SHOOTING_SKILL ( soldier_3 , CRACK_SHOT )
SET_CHAR_THREAT_REACTION ( soldier_1 , REACT_AS_NORMAL )
SET_CHAR_THREAT_REACTION ( soldier_2 , REACT_AS_NORMAL )
SET_CHAR_THREAT_REACTION ( soldier_3 , REACT_AS_NORMAL )
ADD_CHAR_TO_GANG (soldier_1, tankgang)
ADD_CHAR_TO_GANG (soldier_2, tankgang)
ADD_CHAR_TO_GANG (soldier_3, tankgang)*/

//CHANGE_GANG_CHAR_RESPECT (tankgang, p1, 0)
//CHANGE_GANG_CHAR_RESPECT (tankgang, p2, 0)
//CHANGE_GANG_CHAR_RESPECT (tankgang, p3, 0)
//CHANGE_GANG_CHAR_RESPECT (tankgang, p4, 0)

////////////////////////////////////////////////////////////////////////////////////////////////////
//WHILE LOOP
WHILE_EXEC (mainloop = 1)

//TANKER TRAIN EXPLOSION
IF (CHECK_CAR_DAMAGE_LEVEL (train11, 5))
 EXPLODE_LARGE (169.4, 154.3, 1.8)
 EXPLODE_LARGE (168.3, 154.2, 1.9)
 train11 = CREATE_CAR (98.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train12, 5))
 EXPLODE_LARGE (167.3, 155.2, 2.0)
 EXPLODE_LARGE (166.3, 154.3, 1.8)
 train12 = CREATE_CAR (96.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train13, 5))
 EXPLODE_LARGE (165.3, 154.4, 2.0)
 EXPLODE_LARGE (164.3, 153.0, 2.0)
 train13 = CREATE_CAR (94.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train14, 5))
 EXPLODE_LARGE (163.25, 154.4, 2.0)
 EXPLODE_LARGE (162.2, 152.7, 2.0)
 train14 = CREATE_CAR (92.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train15, 5))
 EXPLODE_LARGE (161.25, 154.4, 2.0)
 EXPLODE_LARGE (160.9, 155.6, 2.0)
 train15 = CREATE_CAR (90.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train16, 5))
 EXPLODE_LARGE (159.5, 153.9, 2.0)
 EXPLODE_LARGE (158.25, 154.5, 2.0)
 train16 = CREATE_CAR (88.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train17, 5))
 EXPLODE_LARGE (157.25, 154.3, 2.0)
 EXPLODE_LARGE (156.2, 155.5, 2.1)
 train17 = CREATE_CAR (86.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train18, 5))
 EXPLODE_LARGE (155.25, 154.3, 2.0)
 EXPLODE_LARGE (154.25, 152.6, 2.1)
 train18 = CREATE_CAR (84.0, 200.0, 2.0) 1 0 TANKER END
ENDIF
IF (CHECK_CAR_DAMAGE_LEVEL (train19, 5))
 EXPLODE_LARGE (153.8, 153.7, 2.0)
 EXPLODE_LARGE (152.19, 155.3, 2.1)
 train19 = CREATE_CAR (82.0, 200.0, 2.0) 1 0 TANKER END
ENDIF

//ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM
IF (alarm > 0)
 alarm1 = CREATE_SOUND (144.9, 137.9, 2.0) PRISON_ALARM PLAY_INSTANT END
 alarm2 = CREATE_SOUND (135.9, 125.9, 2.0) PRISON_ALARM PLAY_INSTANT END
ENDIF

SET alarm = 0
//Players who want to get into the Tankbase and drive around in the bus as a passenger.
//p1
IF (CHECK_CHARACTER_HEALTH (p1, 0))
IF (CHECK_SCORE_GREATER (p1, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p1, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p1msg = 0)
   DISPLAY_BRIEF_NOW (1601)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p1, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p1msg = 1
  CHANGE_GANG_CHAR_RESPECT (tankgang, p1, -5)
 ENDIF
 IF (CHECK_RESPECT_LOWER(p1, tankgang, 0))
  SET alarm = 1
 ENDIF
 IF (HAS_CHARACTER_DIED (p1))
  CHANGE_GANG_CHAR_RESPECT (tankgang, p1, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p1, bus1))
  IF (IS_CHAR_PRESSING_HORN (p1))
   IF (p1_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p1, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p1_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p1) ))
	  SET p1_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF
//p2
IF (CHECK_CHARACTER_HEALTH (p2, 0))
IF (CHECK_SCORE_GREATER (p2, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p2, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p2msg = 0)
   DISPLAY_BRIEF_NOW (1602)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p2, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p2msg = 1
	 CHANGE_GANG_CHAR_RESPECT (tankgang, p2, -5)
 ENDIF
 IF (CHECK_RESPECT_LOWER(p2, tankgang, 0))
  SET alarm = 1
 ENDIF
 IF (HAS_CHARACTER_DIED (p2))
	 CHANGE_GANG_CHAR_RESPECT (tankgang, p2, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p2, bus1))
  IF (IS_CHAR_PRESSING_HORN (p2))
   IF (p2_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p2, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p2_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p2) ))
	  SET p2_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF
//p3
IF (CHECK_CHARACTER_HEALTH (p3, 0))
IF (CHECK_SCORE_GREATER (p3, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p3, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p3msg = 0)
   DISPLAY_BRIEF_NOW (1603)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p3, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p3msg = 1
 	CHANGE_GANG_CHAR_RESPECT (tankgang, p3, -5)
 ENDIF
 IF (CHECK_RESPECT_LOWER(p3, tankgang, 0))
  SET alarm = 1
 ENDIF
 IF (HAS_CHARACTER_DIED (p3))
  CHANGE_GANG_CHAR_RESPECT (tankgang, p3, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p3, bus1))
  IF (IS_CHAR_PRESSING_HORN (p3))
   IF (p3_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p3, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p3_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p3) ))
	  SET p3_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF
//p4
IF (CHECK_CHARACTER_HEALTH (p4, 0))
IF (CHECK_SCORE_GREATER (p4, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p4, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p4msg = 0)
   DISPLAY_BRIEF_NOW (1604)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p4, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p4msg = 1
 	CHANGE_GANG_CHAR_RESPECT (tankgang, p4, -5)
 ENDIF
 IF (CHECK_RESPECT_LOWER(p4, tankgang, 0))
  SET alarm = 1
 ENDIF
 IF (HAS_CHARACTER_DIED (p4))
  CHANGE_GANG_CHAR_RESPECT (tankgang, p4, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p4, bus1))
  IF (IS_CHAR_PRESSING_HORN (p4))
   IF (p4_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p4, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p4_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p4) ))
	  SET p4_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF
//p5
IF (CHECK_CHARACTER_HEALTH (p5, 0))
IF (CHECK_SCORE_GREATER (p5, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p5, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p5msg = 0)
   DISPLAY_BRIEF_NOW (1605)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p5, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p5msg = 1
 	CHANGE_GANG_CHAR_RESPECT (tankgang, p5, -5)
 ENDIF
  IF (CHECK_RESPECT_LOWER(p5, tankgang, 0))
   SET alarm = 1
  ENDIF
 IF (HAS_CHARACTER_DIED (p5))
  CHANGE_GANG_CHAR_RESPECT (tankgang, p5, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p5, bus1))
  IF (IS_CHAR_PRESSING_HORN (p5))
   IF (p5_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p5, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p5_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p5) ))
	  SET p5_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF
//p6
IF (CHECK_CHARACTER_HEALTH (p6, 0))
IF (CHECK_SCORE_GREATER (p5, 1))
 IF (LOCATE_CHARACTER_ANY_MEANS (p6, 148.0, 150.0, 2.0, 6.0, 3.0))
  IF (p6msg = 0)
   DISPLAY_BRIEF_NOW (1606)
  ENDIF
 ENDIF
 IF (LOCATE_CHARACTER_ANY_MEANS (p6, 148.0, 145.0, 2.0, 4.0, 4.0) )
  SET p6msg = 1
 	CHANGE_GANG_CHAR_RESPECT (tankgang, p6, -5)
 ENDIF
  IF (CHECK_RESPECT_LOWER(p6, tankgang, 0))
   SET alarm = 1
  ENDIF
 IF (HAS_CHARACTER_DIED (p6))
  CHANGE_GANG_CHAR_RESPECT (tankgang, p6, 5)
 ENDIF
 IF (IS_CHARACTER_IN_CAR (p6, bus1))
  IF (IS_CHAR_PRESSING_HORN (p6))
   IF (p6_trg_horn=1)
    IF (CHECK_CAR_MODEL (bus1, BUS ))
     ORDER_CHAR_TO_BACKDOOR(p6, bus1)
     busdriver = CREATE_CHAR_INSIDE_CAR (bus1) 1 DRIVER END
     STOP_CHAR_DRIVING (busdriver)
     SET_CHAR_OBJECTIVE (busdriver, LEAVE_CAR, bus1)
     SET_CHAR_OBJECTIVE (busdriver, NO_OBJ)
    ENDIF
    SET p6_trg_horn=0
   ENDIF
  ENDIF
  IF (NOT(IS_CHAR_PRESSING_HORN (p6) ))
	  SET p6_trg_horn=1
	 ENDIF
 ENDIF
ENDIF
ENDIF

//Car respawns
IF (IS_CAR_WRECKED (bus1))
 IF (NOT (IS_POINT_ONSCREEN (118.5, 147.5, 2.0)) )
   IF (IS_CAR_IN_BLOCK(bus1, 106.4, 165.0, 2.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (bus1, trailer)
   ENDIF
 DELETE_ITEM (bus1)
 BUS1 = CREATE_CAR (118.5, 147.5, 2.0) 0 180 BUS END
 SET_CAR_BULLETPROOF (bus1, ON)
 SET_CAR_ROCKETPROOF (bus1, ON)
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto1))
 IF (NOT (IS_POINT_ONSCREEN (106.4, 165.0, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto1, 106.4, 165.0, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto1, trailer)
   ENDIF
 DELETE_ITEM (auto1)
 auto1 = CREATE_CAR (106.4, 165.0, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto2))
 IF (NOT (IS_POINT_ONSCREEN (104.2, 165.1, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto2, 104.2, 165.1, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto2, trailer)
   ENDIF
 DELETE_ITEM (auto2)
 auto2 = CREATE_CAR (104.2, 165.1, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto3))
 IF (NOT (IS_POINT_ONSCREEN (116.6, 132.6, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto3, 116.6, 132.6, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto3, trailer)
   ENDIF
 DELETE_ITEM (auto3)
 auto3 = CREATE_CAR (116.6, 132.6) 1 20 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto4))
 IF (NOT (IS_POINT_ONSCREEN (105.2, 165.1, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto4, 105.2, 165.1, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto4, trailer)
   ENDIF
 DELETE_ITEM (auto4)
 auto4 = CREATE_CAR (105.2, 165.1, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto5))
 IF (NOT (IS_POINT_ONSCREEN (107.5, 165.0, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto5, 107.5, 165.0, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto5, trailer)
   ENDIF
 DELETE_ITEM (auto5)
 auto5 = CREATE_CAR (107.5, 165.0, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto6))
 IF (NOT (IS_POINT_ONSCREEN (108.5, 165.0, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto6, 108.5, 165.0, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto6, trailer)
   ENDIF
 DELETE_ITEM (auto6)
 auto6 = CREATE_CAR (108.5, 165.0, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto7))
 IF (NOT (IS_POINT_ONSCREEN (109.6, 165.0, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto7, 109.6, 165.0, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto7, trailer)
   ENDIF
 DELETE_ITEM (auto7)
 auto7 = CREATE_CAR (109.6, 165.0, 1.0) 1 0 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto8))
 IF (NOT (IS_POINT_ONSCREEN (121.3, 111.9, 2.0)) )
   IF (IS_CAR_IN_BLOCK(auto8, 121.3 ,111.9, 2.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto8, trailer)
   ENDIF
 DELETE_ITEM (auto8)
 auto8 = CREATE_CAR (121.3, 111.9, 2.0) 1 0 JEEP END
 GIVE_WEAPON ( auto8 , CAR_MACHINE_GUN , 28 )
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto9))
 IF (NOT (IS_POINT_ONSCREEN (106.6, 135.3, 1.0)) )
   IF (IS_CAR_IN_BLOCK(auto9, 106.6, 135.3, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto9, trailer)
   ENDIF
 DELETE_ITEM (auto9)
 auto9 = CREATE_CAR (106.6, 135.3, 1.0) 1 180 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto10))
 IF (NOT (IS_POINT_ONSCREEN (125.4, 128.9, 2.0)) )
   IF (IS_CAR_IN_BLOCK(auto10, 125.4, 128.9, 2.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto10, trailer)
   ENDIF
 DELETE_ITEM (auto10)
 auto10 = CREATE_CAR (125.4, 128.9, 2.0) 1 345 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto11))
 IF (NOT (IS_POINT_ONSCREEN (91.9, 113.3, 4.0)) )
   IF (IS_CAR_IN_BLOCK(auto11, 91.9, 113.3, 4.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto11, trailer)
   ENDIF
 DELETE_ITEM (auto11)
 auto11 = CREATE_CAR (91.9, 113.3, 4.0) 1 90 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto12))
 IF (NOT (IS_POINT_ONSCREEN (91.9, 112.4, 4.00)) )
   IF (IS_CAR_IN_BLOCK(auto12, 91.9, 112.4, 4.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto12, trailer)
   ENDIF
 DELETE_ITEM (auto12)
 auto12 = CREATE_CAR (91.9, 112.4, 4.0) 1 90 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto13))
 IF (NOT (IS_POINT_ONSCREEN (91.9, 111.4, 4.0)) )
   IF (IS_CAR_IN_BLOCK(auto13, 91.9, 111.4, 4.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto13, trailer)
   ENDIF
 DELETE_ITEM (auto13)
 auto13 = CREATE_CAR (91.9, 111.4, 4.0) 1 90 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto14))
 IF (NOT (IS_POINT_ONSCREEN (91.9, 110.4, 4.0)) )
   IF (IS_CAR_IN_BLOCK(auto14, 91.9, 110.4, 4.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto14, trailer)
   ENDIF
 DELETE_ITEM (auto14)
 auto14 = CREATE_CAR (91.9, 110.4, 4.0) 1 90 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (auto15))
 IF (NOT (IS_POINT_ONSCREEN (91.9, 109.4, 4.0)) )
   IF (IS_CAR_IN_BLOCK(auto15, 91.9, 109.4, 4.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (auto15, trailer)
   ENDIF
 DELETE_ITEM (auto15)
 auto15 = CREATE_CAR (91.9, 109.4, 4.0) 1 90 JEEP END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (tank2))
 IF (NOT (IS_POINT_ONSCREEN (137.0, 123.0, 2.0)) )
   IF (IS_CAR_IN_BLOCK(tank2, 137.0, 123.0, 2.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (tank2, trailer)
   ENDIF
 DELETE_ITEM (tank2)
 tank2 = CREATE_CAR (137.0, 123.0, 2.0) 0 0 TANK END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (zivil1))
 IF (NOT (IS_POINT_ONSCREEN (148.8, 173.1, 1.0)) )
   IF (IS_CAR_IN_BLOCK(zivil1, 148.8, 173.1, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (zivil1, trailer)
   ENDIF
 DELETE_ITEM (zivil1)
 zivil1 = CREATE_CAR (148.8, 173.1, 1.0) 19 85 MORGAN END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (zivil2))
 IF (NOT (IS_POINT_ONSCREEN (142.3, 170.1, 1.0)) )
   IF (IS_CAR_IN_BLOCK(zivil2, 142.3, 170.1, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (zivil2, trailer)
   ENDIF
 DELETE_ITEM (zivil2)
 zivil2 = CREATE_CAR (142.3, 170.1, 1.0) 1 180 BMW END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (zivil3))
 IF (NOT (IS_POINT_ONSCREEN (142.3, 171.7, 2.0)) )
   IF (IS_CAR_IN_BLOCK(zivil3, 142.3, 171.7, 2.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (zivil3, trailer)
   ENDIF
 DELETE_ITEM (zivil3)
 zivil3 = CREATE_CAR (142.3, 171.7, 2.0) 4 180 FIAT END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (zivil4))
 IF (NOT (IS_POINT_ONSCREEN (148.8, 170.5, 1.0)) )
   IF (IS_CAR_IN_BLOCK(zivil4, 148.8, 170.5, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (zivil4, trailer)
   ENDIF
 DELETE_ITEM (zivil4)
 zivil4 = CREATE_CAR (148.8, 170.5, 1.0) 5 90 TBIRD END
 ENDIF
ENDIF
IF (IS_CAR_WRECKED (zivil5))
 IF (NOT (IS_POINT_ONSCREEN (148.8, 174.3, 1.0)) )
   IF (IS_CAR_IN_BLOCK(zivil5, 148.8, 174.3, 1.0, 1.0, 1.0))
   PUT_CAR_ON_TRAILER (zivil5, trailer)
   ENDIF
 DELETE_ITEM (zivil5)
 zivil5 = CREATE_CAR (148.8, 174.3, 1.0) 6 92 MERC END
 ENDIF
ENDIF

// Primitive Live of Tankbots
IF (HAS_CHARACTER_DIED (soldier_1))
 soldier_1 = CREATE_CHAR (144.5, 139.5, 2.0) 1 180 ARMY END
 GIVE_WEAPON ( soldier_1 , MACHINE_GUN)
 ADD_PATROL_POINT (soldier_1, 150.5, 148.5, 2.0)
 ADD_PATROL_POINT (soldier_1, 145.5, 148.5, 2.0)
 SET_CHAR_SHOOTING_SKILL ( soldier_1 , CRACK_SHOT )
 SET_CHAR_THREAT_REACTION ( soldier_1 , REACT_AS_NORMAL )
 ADD_CHAR_TO_GANG (soldier_1, tankgang)
ENDIF
IF (HAS_CHARACTER_DIED (soldier_2))
 soldier_2 = CREATE_CHAR (144.5, 140.5, 2.0) 1 180 ARMY END
 GIVE_WEAPON ( soldier_2 , MACHINE_GUN)
 ADD_PATROL_POINT (soldier_2, 145.5, 147.5, 2.0)
 ADD_PATROL_POINT (soldier_2, 150.5, 147.5, 2.0)
 SET_CHAR_SHOOTING_SKILL ( soldier_2 , CRACK_SHOT )
 SET_CHAR_THREAT_REACTION ( soldier_2 , REACT_AS_NORMAL )
 ADD_CHAR_TO_GANG (soldier_2, tankgang)
ENDIF
IF (HAS_CHARACTER_DIED (soldier_3))
 soldier_3 = CREATE_CHAR (144.5, 142.5, 2.0) 1 180 ARMY END
 GIVE_WEAPON ( soldier_3 , ROCKET_LAUNCHER)
 ADD_PATROL_POINT (soldier_3, 142.5, 129.5, 2.0)
 ADD_PATROL_POINT (soldier_3, 145.5, 129.5, 2.0)
 SET_CHAR_SHOOTING_SKILL ( soldier_3 , CRACK_SHOT )
 SET_CHAR_THREAT_REACTION ( soldier_3 , REACT_AS_NORMAL )
 ADD_CHAR_TO_GANG (soldier_3, tankgang)
ENDIF
ENDWHILE
RETURN
LEVELEND
