// postacie
PLAYER_PED player0 =  ( 121.25  ,  128.5  ,  2.0  )  12   0
PLAYER_PED player1 =  ( 121.75  ,  128.5  ,  2.0  )  8   0
PLAYER_PED player2 =  ( 120.25  ,  128.5  ,  2.0  )  13   0
PLAYER_PED player3 =  ( 120.75  ,  128.5  ,  2.0  )  11  0
PLAYER_PED player4 =  ( 122.25  ,  128.5  ,  2.0  )  9   0
PLAYER_PED player5 =  ( 122.75  ,  128.5  ,  2.0  )  6   0
//CHAR_DATA auciarz = (92.5 , 135.0 , 2.0) 26 0 PSYCHO 

CAR_DATA straz = ( 122.0 , 158.5 , 2.0 ) 0 270 FIRETRUK
CAR_DATA boss2auto =  ( 136.5  ,  133.5  ,  4.0 ) 32 270 EDSELFBI 
CAR_DATA czolg 
CAR_DATA scigacz = ( 128.99 , 132.5 , 2.0 ) 28 110 GT24640
CAR_DATA scigacz2 = ( 128.99 , 133.5 , 2.0 ) 5 110 T2000GT
CAR_DATA scigacz3 = ( 128.99 , 134.5 , 2.0 ) 19 110 MIURA
CAR_DATA scigacz4 = ( 128.99 , 135.5 , 2.0 ) 27 110 TRANCEAM 
CAR_DATA scigacz5 = ( 128.99 , 136.5 , 2.0 ) 31 110 ZCX5  
CAR_DATA auto = ( 92.5 , 137.0 , 2.0 ) 0 40 EDSEL

// liczniki
counter i = 1
counter j = 1
COUNTER gameloop = 1
counter s = 0
counter p = 1
counter onscreen
counter z= 1
counter c = 0
counter l = 1
counter o = 0
counter q = 1
counter w = 0
counter h= 1

GENERATOR bazoka = ( 121.5 , 135.5 , 3.0 ) 0 COLLECT_02 1000 1000 99
GENERATOR bazoka2 = ( 111.5 , 135.5 , 4.0 ) 0 COLLECT_02 1000 1000 99
GENERATOR molotova = ( 120.5 , 127.5 , 4.0 ) 0 COLLECT_04 200 200 99
GENERATOR molotova2 = ( 113.5 , 136.99 , 4.0 ) 0 COLLECT_04 200 200 99
GENERATOR molotova3 = ( 116.5 , 126.5 , 2.0 ) 0 COLLECT_04 200 200 99
GENERATOR gang = ( 138.5 , 135.5 , 2.0 ) 0 COLLECT_40 1000 1000 1 
GENERATOR fr = ( 119.5 , 146.5 , 4.0 ) 0 	COLLECT_36 1000 1000 1
GENERATOR fr2 = ( 109.5 , 135.5 , 4.0 ) 0 	COLLECT_36 1000 1000 1
GENERATOR fr3 = ( 122.5 , 126.5 , 2.0 ) 0 	COLLECT_36 1000 1000 1
GENERATOR flame = ( 109.5 , 145.5 , 3.0 ) 0 	COLLECT_08 1000 1000 99
GENERATOR bombnow = ( 120.5 , 158.5 , 2.0 ) 0 COLLECT_23 1000 1000 1
GENERATOR armor = ( 125.5 , 127.5 , 2.0 ) 0 	COLLECT_31 500 500 1
GENERATOR armor2 = ( 108.99 , 137.99 , 4.0 ) 0 	COLLECT_31 500 500 1
GENERATOR serce = ( 124.5 , 127.5 , 2.0 ) 0 	COLLECT_30 200 200 1
GENERATOR electro = ( 140.5 , 134.5 , 3.0 ) 0 COLLECT_03 1000 1000 99
GENERATOR machine = ( 116.5 , 144.5 , 2.0 ) 0 	COLLECT_01 200 200 99
GENERATOR machine2 = (106.99 , 136.5 , 2.0 ) 0 	COLLECT_09 200 200 99
GENERATOR machine3 = (135.5 , 135.5 , 2.0 ) 0 	COLLECT_01 200 200 99
GENERATOR machine4 = (110.5 , 129.5 , 2.0 ) 0 	COLLECT_01 200 200 99
GENERATOR vehbomb = ( 93.5 , 137.99 , 2.0 ) 0 COLLECT_15  500 500 1 
GENERATOR mina = ( 114.5 , 143.5 , 4.0 ) 0 	COLLECT_17 1000 1000 10
GENERATOR mina2 = ( 121.5 , 127.5 , 4.0 ) 0 	COLLECT_17 1000 1000 10
GENERATOR inble = ( 122.75 , 140.5 , 3.0 ) 0 COLLECT_39 15000 15000 1
GENERATOR olej = ( 121.5 , 145.5 , 2.0 ) 0 COLLECT_16 1800 1800 5
GENERATOR vehmach = ( 118.5 , 146.5 , 2.0 ) 0 COLLECT_18  500 500 50 	
GENERATOR shotg = ( 114.5 , 131.5 , 2.0 ) 0 	COLLECT_06 200 200 99
GENERATOR shotg2 = ( 121.5 , 125.5 , 2.0 ) 0 	COLLECT_06 200 200 99
GENERATOR dd = ( 113.5 , 138.5 , 4.0 ) 0 	COLLECT_35 1000 1000 1
GENERATOR dd2 = ( 112.5 , 126.5 , 2.0 ) 0 	COLLECT_35 1000 1000 1
GENERATOR dupistol = ( 139.99 , 127.99 , 2.0 ) 0 	COLLECT_10 200 200 99
GENERATOR granat = ( 123.5 , 127.5 , 4.0 ) 0 COLLECT_05  200 200 99
GENERATOR fing = ( 110.5 , 144.5 , 2.0) 0 COLLECT_37  1000 1000 99
 	 

LEVELSTART // LEVEL START

	//			SET_CHAR_GRAPHIC_TYPE ( auciarz , DUMMY_GRAPHIC , 26 )
		//		GIVE_WEAPON(auciarz, MOLOTOV)
		//		SET_CHAR_THREAT_SEARCH(auciarz,LINE_OF_SIGHT_PLAYER_ONLY)
		//		SET_CHAR_THREAT_REACTION (auciarz, REACT_AS_NORMAL)


//ADD_ONSCREEN_COUNTER (onscreen, h)
//ADD_ONSCREEN_COUNTER (onscreen, i)

SET_CAR_ROCKETPROOF  (  boss2auto   ,  ON  )

SWITCH_GENERATOR ( bazoka , ON ) 
SWITCH_GENERATOR ( bazoka2 , ON ) 
SWITCH_GENERATOR ( molotova , ON ) 
SWITCH_GENERATOR ( molotova2 , ON ) 
SWITCH_GENERATOR ( molotova3 , ON ) 
SWITCH_GENERATOR ( gang , ON ) 
//SWITCH_GENERATOR ( gang2 , ON )
SWITCH_GENERATOR ( fr , ON ) 
SWITCH_GENERATOR ( fr2 , ON ) 
SWITCH_GENERATOR ( fr3 , ON ) 
SWITCH_GENERATOR ( flame , ON )
SWITCH_GENERATOR ( bombnow , ON ) 
SWITCH_GENERATOR ( armor , ON ) 
SWITCH_GENERATOR ( armor2 , ON ) 
SWITCH_GENERATOR ( serce , ON ) 
SWITCH_GENERATOR ( electro , ON ) 
SWITCH_GENERATOR ( machine , ON ) 
SWITCH_GENERATOR ( machine2 , ON ) 
SWITCH_GENERATOR ( machine3 , ON ) 
SWITCH_GENERATOR ( machine4 , ON ) 
SWITCH_GENERATOR ( vehbomb , ON )
SWITCH_GENERATOR ( mina , ON )  
SWITCH_GENERATOR ( mina2 , ON ) 
SWITCH_GENERATOR ( inble , ON )  
SWITCH_GENERATOR ( olej , ON )  
SWITCH_GENERATOR ( vehmach , ON )  
SWITCH_GENERATOR ( shotg , ON )  
SWITCH_GENERATOR ( shotg2 , ON )
SWITCH_GENERATOR ( dd , ON ) 
SWITCH_GENERATOR ( dd2 , ON )  
SWITCH_GENERATOR ( dupistol , ON )  
SWITCH_GENERATOR ( granat , ON )  
SWITCH_GENERATOR ( fing , ON ) 

SET_AMBIENT_LEVEL ( 1.0 , 0 ) // jasnosc
DECLARE_POLICELEVEL ( 6 ) // policja

SET_CAR_BULLETPROOF  (  straz   ,  ON  )
SET_CAR_ROCKETPROOF  (  straz   ,  ON  )
//SET_CAR_JAMMED_ACCELERATOR (auto, ON) 
GIVE_WEAPON (straz, CAR_FLAMETHROWER) 
SET_CAR_FLAMEPROOF  (  straz   ,  ON  )
SET_CAR_NO_COLLIDE (straz)

WHILE_EXEC ( p = 1 ) // MAIN LOOP

WHILE_EXEC(z<6) // CAR WEAPON
  IF (z=1)  SET c = (scigacz+0)  ENDIF
  IF (z=2)  SET c = (scigacz2+0)  ENDIF
  IF (z=3)  SET c = (scigacz3+0)  ENDIF
  IF (z=4)  SET c = (scigacz4+0)  ENDIF
  IF (z=5)  SET c = (scigacz5+0)  ENDIF
		IF (CHECK_CAR_DAMAGE_LEVEL (c, 0))
  GIVE_WEAPON (c, CAR_MACHINE_GUN, 10)
		ENDIF
		++z
ENDWHILE // CAR WEAPON END

SET l=0
WHILE_EXEC((l<6)AND(i=1)) // TANK START
  IF (l=1)  SET o = (player0+0)  ENDIF
  IF (l=2)  SET o = (player1+0)  ENDIF
  IF (l=3)  SET o = (player2+0)  ENDIF
  IF (l=4)  SET o = (player3+0)  ENDIF
  IF (l=5)  SET o = (player4+0)  ENDIF
  IF (l=5)  SET o = (player5+0)  ENDIF
		IF (IS_CAR_WRECKED(boss2auto)) ++i ENDIF	
		IF	(CHECK_CHARACTER_HEALTH (  o  ,  0  ))
		  IF( IS_CHARACTER_IN_CAR  (  o  ,  boss2auto  ))
				  IF (j<2) DISPLAY_BRIEF (  1288  ) ++j ENDIF 		
				  IF ( IS_CHAR_PRESSING_HORN  (o)  ) 
				    ++i 
		      TAKE_REMOTE_CONTROL_OF_CAR (o, straz)
						  SET s=1
		    ENDIF						
    ENDIF		
  ENDIF							
++l
ENDWHILE

IF (( gameloop = 1 ) AND (s=1))			
  IF ( is_car_wrecked ( straz ))
    czolg = CREATE_CAR ( 122.99 , 126.99 , 2.0 ) 0 0 TANK END
    SET_CAR_ROCKETPROOF  (  czolg   ,  ON  )
    DISPLAY_BRIEF (  3650  )
    SET gameloop = 2
  ENDIF
ENDIF // TANK END



IF (IS_CAR_WRECKED(auto)) // ODNAWIANIE AUT										
  IF (NOT (IS_POINT_ONSCREEN (92.5 , 137.0 , 2.0)))
    DELETE_ITEM(auto)
    auto = CREATE_CAR ( 92.5 , 137.0 , 3.0 ) 0 35 EDSEL END
    GIVE_DRIVER_AND_BRAKE(auto)
  ENDIF
ENDIF


IF (IS_CAR_WRECKED(scigacz))
  IF (NOT (IS_POINT_ONSCREEN (128.99 , 132.5 , 2.0)) )
    DELETE_ITEM(scigacz)
    scigacz = CREATE_CAR ( 128.99 , 132.5 , 3.0 ) 28 110 GT24640 END
    GIVE_DRIVER_AND_BRAKE(scigacz)
  		GIVE_WEAPON (scigacz, CAR_MACHINE_GUN, 10)
  ENDIF
ENDIF

IF (IS_CAR_WRECKED(scigacz2))
  IF (NOT (IS_POINT_ONSCREEN (128.99 , 133.5 , 2.0)) )
    DELETE_ITEM(scigacz2)
    scigacz2 = CREATE_CAR ( 128.99 , 133.5 , 3.0 ) 5 110 T2000GT END
    GIVE_DRIVER_AND_BRAKE(scigacz2)
    				GIVE_WEAPON (scigacz2, CAR_MACHINE_GUN, 10)


  ENDIF
ENDIF

IF (IS_CAR_WRECKED(scigacz3))
  IF (NOT (IS_POINT_ONSCREEN (128.99 , 134.5 , 2.0)) )
    DELETE_ITEM(scigacz3)
    scigacz3 = CREATE_CAR ( 128.99 , 134.5 , 3.0 ) 19 110 MIURA END
    GIVE_DRIVER_AND_BRAKE(scigacz3)
    				GIVE_WEAPON (scigacz3, CAR_MACHINE_GUN, 10)
  ENDIF
ENDIF

IF (IS_CAR_WRECKED(scigacz4))
  IF (NOT (IS_POINT_ONSCREEN (128.99 , 135.5 , 2.0)) )
    DELETE_ITEM(scigacz4)
    scigacz4 = CREATE_CAR( 128.99 , 135.5 , 3.0 ) 27 110 TRANCEAM END
    GIVE_DRIVER_AND_BRAKE(scigacz4)
				GIVE_WEAPON (scigacz4, CAR_MACHINE_GUN, 10)

  ENDIF
ENDIF

IF (IS_CAR_WRECKED(scigacz5))
  IF (NOT (IS_POINT_ONSCREEN (128.99 , 136.5 , 2.0)) )
    DELETE_ITEM(scigacz5)
    scigacz5 = CREATE_CAR( 128.99 , 136.5 , 3.0 ) 31 110 ZCX5 END
    GIVE_DRIVER_AND_BRAKE(scigacz5)
				  GIVE_WEAPON (scigacz5, CAR_MACHINE_GUN, 10)

  ENDIF
ENDIF // ODNAWIANIE AUT KONIEC



ENDWHILE // END MAIN LOOP



LEVELEND


