// Players
PLAYER_PED p1 = ( 65.0 , 152.0 , 1.0 ) 25 270 //( 63.0 , 156.5 , 2.0 ) 28 90 
OBJ_DATA pilka

OBJ_DATA pilka_pause = ( 61.0 , 158.0 ) 0 FOOTY

CAR_DATA check_car
PARKED_CAR_DATA  tr = ( 43.5 , 122.5 , 2.0 ) 34 90 TRUKTRNS

PARKED_CAR_DATA  tanki = ( 60.25 , 160.0 , 2.0 ) 34 66 TANK 
PARKED_CAR_DATA  tanki1 = ( 62.0 , 160.0 , 2.0 ) 34 0 TANK 
PARKED_CAR_DATA  tanki2 = ( 63.0 , 160.0 , 2.0 ) 34 0 TANK 
PARKED_CAR_DATA  tanki3 = ( 64.0 , 160.0 , 2.0 ) 34 0 TANK 
PARKED_CAR_DATA  tanki4 = ( 65.0 , 160.0 , 2.0 ) 34 0 TANK 
PARKED_CAR_DATA  tanki5 = ( 66.0 , 160.0 , 2.0 ) 34 0 TANK 
PARKED_CAR_DATA  tanki6 = ( 67.0 , 160.0 , 2.0 ) 34 0 TANK
PARKED_CAR_DATA  tanki7 = ( 68.0 , 160.0 , 2.0 ) 34 0 TANK
PARKED_CAR_DATA  tanki8 = ( 69.0 , 160.0 , 2.0 ) 34 0 TANK
PARKED_CAR_DATA  tanki9 = ( 70.0 , 160.0 , 2.0 ) 34 0 TANK


CHAR_DATA tank_char1
CHAR_DATA tank_char2
CHAR_DATA tank_char3
CHAR_DATA tank_char4
CHAR_DATA tank_char5
CHAR_DATA tank_char6
CHAR_DATA tank_char7
CHAR_DATA tank_char8
CHAR_DATA tank_char9

ONSCREEN_COUNTER o
COUNTER gol_counter
COUNTER loop = 0
COUNTER misja = 0
COUNTER car_resp = 0
COUNTER blokada2 = 0
COUNTER blokada3 = 0
COUNTER blokada4 = 0
COUNTER blokada5 = 0
COUNTER blokada6 = 0
COUNTER blokada7 = 0
COUNTER blokada8 = 0
COUNTER blokada9 = 0



LEVELSTART

SET_CAR_ROCKETPROOF ( tanki , ON)
SET_CAR_ROCKETPROOF ( tanki1 , ON)
SET_CAR_ROCKETPROOF ( tanki2 , ON)
SET_CAR_ROCKETPROOF ( tanki3 , ON)
SET_CAR_ROCKETPROOF ( tanki4 , ON)
SET_CAR_ROCKETPROOF ( tanki5 , ON)
SET_CAR_ROCKETPROOF ( tanki6 , ON)
SET_CAR_ROCKETPROOF ( tanki7 , ON)
SET_CAR_ROCKETPROOF ( tanki8 , ON)
SET_CAR_ROCKETPROOF ( tanki9 , ON)




ADD_ONSCREEN_COUNTER ( o , gol_counter)

check_car = CREATE_CAR (  59.60 , 157.5, 2.0  ) 2 90 ZCX5 END
pilka = CREATE_OBJ ( 66.0 , 152.05 , 1.0 ) 0 FOOTY END


// Environment
SET_AMBIENT_LEVEL  (0.67, 0) 
SET_SHADING_LEVEL (20)

WHILE_EXEC ( loop = 0 )

IF (misja = 0)
 tank_char1 = CREATE_CHAR_INSIDE_CAR ( tanki1 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char1 )
 PUT_CAR_ON_TRAILER ( tanki1 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char1 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET misja = 1 
ENDIF

IF (( blokada2 = 0 )
AND (NOT(DELAY(6))))
 tank_char2 = CREATE_CHAR_INSIDE_CAR ( tanki2 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char2 )
 PUT_CAR_ON_TRAILER ( tanki2 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char2 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada2 = 1
ENDIF

IF (( blokada3 = 0 )
AND (NOT(DELAY(12))))
 tank_char3 = CREATE_CHAR_INSIDE_CAR ( tanki3 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char3 )
 PUT_CAR_ON_TRAILER ( tanki3 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char3 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada3 = 1
ENDIF

IF (( blokada4 = 0 )
AND (NOT(DELAY(18))))
 tank_char4 = CREATE_CHAR_INSIDE_CAR ( tanki4 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char4 )
 PUT_CAR_ON_TRAILER ( tanki4 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char4 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada4 = 1
ENDIF

IF (( blokada5 = 0 )
AND (NOT(DELAY(24))))
 tank_char5 = CREATE_CHAR_INSIDE_CAR ( tanki5 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char5 )
 PUT_CAR_ON_TRAILER ( tanki5 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char5 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada5 = 1
ENDIF

IF (( blokada6 = 0 )
AND (NOT(DELAY(30))))
 tank_char6 = CREATE_CHAR_INSIDE_CAR ( tanki6 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char6 )
 PUT_CAR_ON_TRAILER ( tanki6 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char6 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada6 = 1
ENDIF

IF (( blokada7 = 0 )
AND (NOT(DELAY(36))))
 tank_char7 = CREATE_CHAR_INSIDE_CAR ( tanki7 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char7 )
 PUT_CAR_ON_TRAILER ( tanki7 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char7 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada7 = 1
ENDIF

IF (( blokada8 = 0 )
AND (NOT(DELAY(42))))
 tank_char8 = CREATE_CHAR_INSIDE_CAR ( tanki8 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char8 )
 PUT_CAR_ON_TRAILER ( tanki8 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char8 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada8 = 1
ENDIF

IF (( blokada9 = 0 )
AND (NOT(DELAY(48))))
 tank_char9 = CREATE_CHAR_INSIDE_CAR ( tanki9 ) 13 criminal END
 STOP_CHAR_DRIVING ( tank_char9 )
 PUT_CAR_ON_TRAILER ( tanki9 , tanki )
 SET_CHAR_OBJECTIVE ( tank_char9 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET blokada9 = 1
ENDIF




IF (( car_resp = 1 )
AND (NOT(DELAY(100))))
 PUT_CAR_ON_TRAILER ( check_car , tr )
 DELETE_ITEM ( check_car )
 check_car = CREATE_CAR (  59.65 , 157.5, 2.0  ) 2 90 ZCX5 END
 pilka = CREATE_OBJ ( 66.0 , 152.05 , 1.0 ) 0 FOOTY END
 SET car_resp = 2
ENDIF

IF (( car_resp = 2 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char1 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 3
ENDIF
IF (( car_resp = 3 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char2 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 4
ENDIF
IF (( car_resp = 4 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char3 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 5
ENDIF
IF (( car_resp = 5 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char4 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 6
ENDIF
IF (( car_resp = 6 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char5 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 7
ENDIF
IF (( car_resp = 7 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char6 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 8
ENDIF
IF (( car_resp = 8 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char7 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 9
ENDIF
IF (( car_resp = 9 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char8 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 10
ENDIF
IF (( car_resp = 10 )
AND (NOT(DELAY(5))))
 SET_CHAR_OBJECTIVE ( tank_char9 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka )
 SET car_resp = 0
ENDIF



IF (( IS_CAR_WRECKED ( check_car))
AND ( car_resp = 0 ))
 ++ gol_counter
 SET_CHAR_OBJECTIVE ( tank_char1 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char2 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char3 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char4 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char5 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char6 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char7 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char8 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 SET_CHAR_OBJECTIVE ( tank_char9 , FIRE_AT_OBJECT_FROM_VEHICLE , pilka_pause )
 DELETE_ITEM ( pilka )
 SET car_resp = 1
ENDIF



ENDWHILE


LEVELEND
