//Players Delcare:
PLAYER_PED p1 = (105.5, 240.5, 2.0) 8 225   //Gray 
PLAYER_PED p2 = (87.5, 240.5, 2.0) 13 135  //Blue
PLAYER_PED p3 = (87.5, 222.5, 2.0) 11 45  //Green
PLAYER_PED p4 = (105.5, 222.5, 2.0) 9 315  //Orange
PLAYER_PED p5 = (111.5, 232.5, 2.0) 7 90  //Yellow
PLAYER_PED p6 = (112.5, 248.5, 2.0) 10 0  //Red


COUNTER loop = 1
//Cars:
PARKED_CAR_DATA fire1 = (98.5, 251.8, 2.0) 17 180 BUS
PARKED_CAR_DATA bus1 = (81.2, 239.5, 2.0) 17 90 BUS
PARKED_CAR_DATA fire2 = (81.2, 242.5, 2.0) 17 90 BUS
PARKED_CAR_DATA fire3 = (81.2, 222.5, 2.0) 17 90 BUS
PARKED_CAR_DATA bus2 = (81.2, 226.5, 2.0) 17 90 BUS
PARKED_CAR_DATA bus3 = (115.8, 220.5, 2.0) 17 270 BUS
PARKED_CAR_DATA fire4 = (116.5, 228.8, 2.0) 17 180 BUS
PARKED_CAR_DATA bus4 = (115.5, 237.8, 2.0) 17 180 BUS

CAR_DATA p1_current_car
CAR_DATA p2_current_car

//Weapons and powerups:

GENERATOR zooka1 = ( 104.5, 239.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka2 = ( 89.5, 239.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka3 = ( 89.5, 224.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka4 = ( 104.5, 224.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka5 = ( 113.0, 232.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka6 = ( 113.0, 250.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR zooka7 = ( 86.5, 232.5, 2.0 ) 0 COLLECT_02 1 1 99
GENERATOR koka1 = (105.0, 249.0, 2.0 ) 0 COLLECT_04 1 1 99
GENERATOR koka2 = (86.5, 250.5, 2.0 ) 0 COLLECT_04 1 1 99

COUNTER count_live_1
COUNTER count_live_2
COUNTER count_live_3
COUNTER count_live_4
COUNTER count_live_5
COUNTER count_live_6
COUNTER give_w_1
COUNTER give_w_2
COUNTER give_w_3
COUNTER give_w_4
COUNTER give_w_5
COUNTER give_w_6

LEVELSTART 

GIVE_WEAPON ( bus1 , CAR_MACHINE_GUN ,  1)
GIVE_WEAPON ( bus2 , CAR_MACHINE_GUN ,  1)
GIVE_WEAPON ( bus3 , CAR_MACHINE_GUN ,  1)
GIVE_WEAPON ( bus4 , CAR_MACHINE_GUN ,  1)
GIVE_WEAPON ( fire1 , CAR_MACHINE_GUN , 1)
GIVE_WEAPON ( fire2 , CAR_MACHINE_GUN , 1)
GIVE_WEAPON ( fire3 , CAR_MACHINE_GUN , 1)
GIVE_WEAPON ( fire4 , CAR_MACHINE_GUN , 1)

SWITCH_GENERATOR ( zooka1 , ON )
SWITCH_GENERATOR ( zooka2 , ON )
SWITCH_GENERATOR ( zooka3 , ON )
SWITCH_GENERATOR ( zooka4 , ON )
SWITCH_GENERATOR ( zooka5 , ON )
SWITCH_GENERATOR ( zooka6 , ON )
SWITCH_GENERATOR ( zooka7 , ON )
SWITCH_GENERATOR ( koka1 , ON )
SWITCH_GENERATOR ( koka2 , ON )

IF (CHECK_CHARACTER_HEALTH ( p1 , 0))
 ADD_LIVES ( p1 , -5 )  
ENDIF
IF (CHECK_CHARACTER_HEALTH ( p2 , 0))
 ADD_LIVES ( p2 , -5 )  
ENDIF
IF (CHECK_CHARACTER_HEALTH ( p3 , 0))
 ADD_LIVES ( p3 , -5 )  
ENDIF
IF (CHECK_CHARACTER_HEALTH ( p4 , 0))
 ADD_LIVES ( p4 , -5 )  
ENDIF
IF (CHECK_CHARACTER_HEALTH ( p5 , 0))
 ADD_LIVES ( p5 , -5 )  
ENDIF
IF (CHECK_CHARACTER_HEALTH ( p6 , 0))
 ADD_LIVES ( p6 , -5 )  
ENDIF

WHILE_EXEC (loop = 1)

//p1
IF ((CHECK_CHARACTER_HEALTH ( p1 , 0))
AND (CHECK_SCORE_GREATER ( p1 , -1)))
  STORE_NUM_LIVES ( p1 , count_live_1 ) 
  //p1
  IF (( HAS_CHAR_JUST_SUNK ( p1 ))
  AND ( count_live_1 < 2 ))
   ADD_LIVES ( p1 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p1 )) 
  AND (HAS_CHARACTER_DIED ( p1 )))
  AND ( count_live_1 < 2 ))
   ADD_LIVES ( p1 , 2 )  
  ENDIF
  IF ((count_live_1 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p1 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p1 ))
  AND ( give_w_1 = 0 ))
   SET give_w_1 = 1
  ENDIF
  IF (( give_w_1 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p1 , MOLOTOV , 3 )
   GIVE_WEAPON ( p1 , ROCKET_LAUNCHER , 3 )
   SET give_w_1 = 0
  ENDIF
ENDIF 
//p2
IF ((CHECK_CHARACTER_HEALTH ( p2 , 0))
AND (CHECK_SCORE_GREATER ( p2 , -1)))
  STORE_NUM_LIVES ( p2 , count_live_2 )
  // p2
  IF (( HAS_CHAR_JUST_SUNK ( p2 ))
  AND ( count_live_2 < 2 ))
   ADD_LIVES ( p2 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p2 )) 
  AND (HAS_CHARACTER_DIED ( p2 )))
  AND ( count_live_2 < 2 ))
   ADD_LIVES ( p2 , 2 )  
  ENDIF
  IF ((count_live_2 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p2 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p2 ))
  AND ( give_w_2 = 0 ))
   SET give_w_2 = 1
  ENDIF
  IF (( give_w_2 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p2 , MOLOTOV , 3 )
   GIVE_WEAPON ( p2 , ROCKET_LAUNCHER , 3 )
   SET give_w_2 = 0
  ENDIF
ENDIF
//p3
IF ((CHECK_CHARACTER_HEALTH ( p3 , 0))
AND (CHECK_SCORE_GREATER ( p3 , -1)))
  STORE_NUM_LIVES ( p3 , count_live_3 )
  // p3
  IF (( HAS_CHAR_JUST_SUNK ( p3 ))
  AND ( count_live_3 < 2 ))
   ADD_LIVES ( p3 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p3 )) 
  AND (HAS_CHARACTER_DIED ( p3 )))
  AND ( count_live_3 < 2 ))
   ADD_LIVES ( p3 , 2 )  
  ENDIF
  IF ((count_live_3 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p3 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p3 ))
  AND ( give_w_3 = 0 ))
   SET give_w_3 = 1
  ENDIF
  IF (( give_w_3 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p3 , MOLOTOV , 3 )
   GIVE_WEAPON ( p3 , ROCKET_LAUNCHER , 3 )
   SET give_w_3 = 0
  ENDIF
ENDIF
//p4
IF ((CHECK_CHARACTER_HEALTH ( p4 , 0))
AND (CHECK_SCORE_GREATER ( p4 , -1)))
  STORE_NUM_LIVES ( p4 , count_live_4 )
  // p4
  IF (( HAS_CHAR_JUST_SUNK ( p4 ))
  AND ( count_live_4 < 2 ))
   ADD_LIVES ( p4 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p4 )) 
  AND (HAS_CHARACTER_DIED ( p4 )))
  AND ( count_live_4 < 2 ))
   ADD_LIVES ( p4 , 2 )  
  ENDIF
  IF ((count_live_4 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p4 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p4 ))
  AND ( give_w_4 = 0 ))
   SET give_w_4 = 1
  ENDIF
  IF (( give_w_4 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p4 , MOLOTOV , 3 )
   GIVE_WEAPON ( p4 , ROCKET_LAUNCHER , 3 )
   SET give_w_4 = 0
  ENDIF
ENDIF
//p5
IF ((CHECK_CHARACTER_HEALTH ( p5 , 0))
AND (CHECK_SCORE_GREATER ( p5 , -1)))
  STORE_NUM_LIVES ( p5 , count_live_5 )
  // p5
  IF (( HAS_CHAR_JUST_SUNK ( p5 ))
  AND ( count_live_5 < 2 ))
   ADD_LIVES ( p5 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p5 )) 
  AND (HAS_CHARACTER_DIED ( p5 )))
  AND ( count_live_5 < 2 ))
   ADD_LIVES ( p5 , 2 )  
  ENDIF
  IF ((count_live_5 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p5 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p5 ))
  AND ( give_w_5 = 0 ))
   SET give_w_5 = 1
  ENDIF
  IF (( give_w_5 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p5 , MOLOTOV , 3 )
   GIVE_WEAPON ( p5 , ROCKET_LAUNCHER , 3 )
   SET give_w_5 = 0
  ENDIF
ENDIF
//p6
IF ((CHECK_CHARACTER_HEALTH ( p6 , 0))
AND (CHECK_SCORE_GREATER ( p6 , -1)))
  STORE_NUM_LIVES ( p6 , count_live_6 )
  // p6
  IF (( HAS_CHAR_JUST_SUNK ( p6 ))
  AND ( count_live_6 < 2 ))
   ADD_LIVES ( p6 , 2 )  
  ENDIF
  IF (((IS_CHARACTER_IN_ANY_CAR ( p6 )) 
  AND (HAS_CHARACTER_DIED ( p6 )))
  AND ( count_live_6 < 2 ))
   ADD_LIVES ( p6 , 2 )  
  ENDIF
  IF ((count_live_6 = 2)
  AND (NOT(DELAY(60))))
   ADD_LIVES ( p6 , -2 )
  ENDIF
  IF ((HAS_CHARACTER_DIED ( p6 ))
  AND ( give_w_6 = 0 ))
   SET give_w_6 = 1
  ENDIF
  IF (( give_w_6 = 1 )
  AND (NOT(DELAY(80))))
   GIVE_WEAPON ( p6 , MOLOTOV , 3 )
   GIVE_WEAPON ( p6 , ROCKET_LAUNCHER , 3 )
   SET give_w_6 = 0
  ENDIF
ENDIF

ENDWHILE


LEVELEND
