//Gracze // Players 
PLAYER_PED p1 = (5.50, 14.50, 2.00) 10 90 //Russian
PLAYER_PED p2 = (21.0, 53.5, 2.0) 9 270 // Kristna
PLAYER_PED p3 = (55.0, 58.5, 2.0) 13 0 // Yakuza
PLAYER_PED p4 = (79.0, 30.0, 2.0) 5 90 // Rednecks

// Zmienne // Counters 
CAR_DATA Auto1 = ( 1.3, 47.45, 2.0 ) 3 270 VAN
CAR_DATA Auto2 = ( 3.0, 9.7, 2.0 ) 28 315 BUICK
CAR_DATA Auto3 = ( 1.5, 17.5, 2.0 ) 0 90 MEDICAR
CAR_DATA Auto4 = ( 74.5, 11.5, 2.0 ) 1 0 EDSEL
CAR_DATA Auto5 = ( 75.5, 11.5, 2.0 ) 15 0 GT24640
CAR_DATA Auto6 = ( 76.0, 59.0, 2.0 ) 19 0 MIURA
CAR_DATA p1_current_car
CAR_DATA p2_current_car
CAR_DATA p3_current_car
CAR_DATA p4_current_car
COUNTER protect_team1
COUNTER protect_team2
COUNTER horn_p1
COUNTER horn_p2
COUNTER horn_p3
COUNTER horn_p4
COUNTER who_is_passanger_team1
COUNTER who_is_passanger_team2
COUNTER loop = 1

// NIEWIDZIALNE SCIANY (Mury, Kolumny itp...) // INVISIBLE WALLS 
OBJ_DATA bariera01 = (6.87, 13.24, 2.0) 0 TOWER //Mur przy szpitalu1
OBJ_DATA bariera02 = (6.61, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera03 = (6.35, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera04 = (6.09, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera05 = (5.83, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera06 = (5.57, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera07 = (5.31, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera08 = (5.05, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera09 = (4.79, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera10 = (4.53, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera11 = (4.27, 13.24, 2.0) 0 TOWER
OBJ_DATA bariera12 = (7.20, 7.21, 2.0) 0 TOWER //Reklama KGBH
OBJ_DATA bariera13 = (7.20, 7.19, 2.0) 180 TOWER
OBJ_DATA bariera14 = (34.80, 11.76, 2.0) 180 TOWER //Elektroslup przy zbiorniku
OBJ_DATA bariera15 = (34.87, 11.80, 2.0) 90 TOWER
OBJ_DATA bariera16 = (34.76, 11.80, 2.0) 270 TOWER
OBJ_DATA bariera17 = (60.76, 58.86, 2.0) 270 TOWER //Mur przy sklepie
OBJ_DATA bariera18 = (60.76, 58.61, 2.0) 270 TOWER
OBJ_DATA bariera19 = (60.76, 58.36, 2.0) 270 TOWER
OBJ_DATA bariera20 = (60.76, 58.11, 2.0) 270 TOWER
OBJ_DATA bariera21 = (60.76, 57.86, 2.0) 270 TOWER
OBJ_DATA bariera22 = (60.76, 57.61, 2.0) 270 TOWER
OBJ_DATA bariera23 = (60.76, 57.36, 2.0) 270 TOWER
OBJ_DATA bariera24 = (60.76, 57.11, 2.0) 270 TOWER
OBJ_DATA bariera25 = (60.76, 56.86, 2.0) 270 TOWER
OBJ_DATA bariera26 = (60.76, 56.61, 2.0) 270 TOWER
OBJ_DATA bariera27 = (60.76, 56.36, 2.0) 270 TOWER
OBJ_DATA bariera28 = (60.76, 56.11, 2.0) 270 TOWER
OBJ_DATA bariera29 = (60.76, 55.86, 2.0) 270 TOWER
OBJ_DATA bariera30 = (60.76, 55.61, 2.0) 270 TOWER
OBJ_DATA bariera31 = (60.76, 55.36, 2.0) 270 TOWER
OBJ_DATA bariera32 = (60.76, 55.11, 2.0) 270 TOWER
OBJ_DATA bariera33 = (60.76, 54.86, 2.0) 270 TOWER
OBJ_DATA bariera34 = (30.5, 45.50, 2.0) 0 TOWER //Latarnia na molo

// Dzwigi/Zurawie // 
CRANE_DATA Dzwig01 = (90.5, 42.5) 45 NO_HOMECRANE FIRST (90.5, 44.5) 90
CRANE_DATA Dzwig02 = (56.5, 26.5) 320 NO_HOMECRANE

// Radio 
RADIO_STATION radio01 = STATION_INDUSTRIAL (37.5, 45.5)

// Bronie // Weapons 
GENERATOR Rakietnica1 = (41.5, 19.5, 4.0) 0 collect_02 5142 5142 5
GENERATOR Rakietnica2 = (24.5, 53.5, 2.0) 0 collect_02 5142 5142 5
GENERATOR Rakietnica3 = (62.0, 50.5, 3.0) 0 collect_02 5142 5142 5
GENERATOR Rakietnica4 = (76.0, 19.0, 3.0) 0 collect_02 5142 5142 5
GENERATOR Zdrowie = (94.0, 28.0, 2.0) 0 collect_30 5142 5142 1
GENERATOR Pancerz = (43.5, 26.5, 2.0) 0 collect_31 5142 5142 1
GENERATOR PodwojneZniszczenie = (45.5, 50.5, 2.0) 0 collect_35 5142 5142 1
GENERATOR SzybkiePrzeladowanie = (4.0, 24.5, 2.0) 0 collect_36 5142 5142 1
GENERATOR Strzelba1 = (41.5, 26.5, 2.0) 0 collect_06 5142 5142 10
GENERATOR Strzelba2 = (18.5, 53.5, 2.0) 0 collect_06 5142 5142 10
GENERATOR Strzelba3 = (52.5, 49.5, 2.0) 0 collect_06 5142 5142 10
GENERATOR Koktajl1 = (50.5, 31.5, 2.0) 0 collect_04 5142 5142 8
GENERATOR Koktajl2 = (13.5, 3.5, 3.0) 0 collect_04 5142 5142 8
GENERATOR Granaty1 = (13.0, 58.0, 2.0) 0 collect_05 5142 5142 12
GENERATOR Granaty2 = (66.0, 37.0, 2.0) 0 collect_05 5142 5142 12
GENERATOR ElektroPalce = (39.5, 44.5, 2.0) 0 collect_37 5142 5142 1
GENERATOR Karabin1 = (56.5, 49.5, 2.0) 0 collect_01 5142 5142 10
GENERATOR Karabin2 = (19.5, 3.5, 2.0) 0 collect_01 5142 5142 10
GENERATOR PodwojnyPistolet1 = (81.5, 22.5, 2.0) 0 collect_10 5142 5142 30
GENERATOR PodwojnyPistolet2 = (60.5, 60.5, 2.0) 0 collect_10 5142 5142 30
GENERATOR PodwojnyPistolet3 = (7.5, 61.5, 2.0) 0 collect_10 5142 5142 30
GENERATOR ElektroArmata1 = (43.5, 3.0, 2.0) 0 collect_03 5142 5142 6 
GENERATOR ElektroArmata2 = (55.0, 64.5, 3.0) 0 collect_03 5142 5142 6 
GENERATOR MiotaczOgnia1 = (7.0, 30.0, 4.0) 0 collect_08 5142 5142 10 
GENERATOR MiotaczOgnia2 = (74.0, 32.0, 2.0) 0 collect_08 5142 5142 10 
GENERATOR KarabinSamochodowy = (19.0, 17.0, 4.0) 0 collect_18 5142 5142 10
GENERATOR OlejSamochodowy = (86.0, 28.0, 2.0) 0 collect_16 5142 5142 6
GENERATOR BombaSamochodowa = (37.0, 48.0, 2.0) 0 collect_15 5142 5142 1

LEVELSTART

//Zmiana Skinu 2-gi gracz
IF (CHECK_CHARACTER_HEALTH ( p2 , 0) )
   SET_CHAR_GRAPHIC_TYPE ( p2 , GANG_GRAPHIC , 10 )
ENDIF
//Zmiana Skinu 4-ty gracz
IF (CHECK_CHARACTER_HEALTH ( p4 , 0) )
   SET_CHAR_GRAPHIC_TYPE ( p4 , GANG_GRAPHIC , 13 )
ENDIF

// Deklaracje // Declare 
SET_AMBIENT_LEVEL  (0.25,0)
SET_SHADING_LEVEL (20)
SET_DIR_OF_TV_VANS (37.5, 45.5)
DECLARE_POLICELEVEL (5)

//Aktywacja generatorow // Activate generators 
SWITCH_GENERATOR ( Rakietnica1, ON )
SWITCH_GENERATOR ( Rakietnica2, ON )
SWITCH_GENERATOR ( Rakietnica3, ON )
SWITCH_GENERATOR ( Rakietnica4, ON )
SWITCH_GENERATOR ( MiotaczOgnia1, ON )
SWITCH_GENERATOR ( MiotaczOgnia2, ON )
SWITCH_GENERATOR ( Granaty1, ON )
SWITCH_GENERATOR ( Granaty2, ON )
SWITCH_GENERATOR ( Koktajl1, ON )
SWITCH_GENERATOR ( Koktajl2, ON )
SWITCH_GENERATOR ( KarabinSamochodowy, ON )
SWITCH_GENERATOR ( OlejSamochodowy, ON )
SWITCH_GENERATOR ( BombaSamochodowa, ON )
SWITCH_GENERATOR ( PodwojnyPistolet1, ON )
SWITCH_GENERATOR ( PodwojnyPistolet2, ON )
SWITCH_GENERATOR ( PodwojnyPistolet3, ON )
SWITCH_GENERATOR ( Strzelba1, ON )
SWITCH_GENERATOR ( Strzelba2, ON )
SWITCH_GENERATOR ( Strzelba3, ON )
SWITCH_GENERATOR ( Zdrowie, ON )
SWITCH_GENERATOR ( Pancerz, ON )
SWITCH_GENERATOR ( PodwojneZniszczenie, ON )
SWITCH_GENERATOR ( SzybkiePrzeladowanie, ON )
SWITCH_GENERATOR ( Karabin1, ON )
SWITCH_GENERATOR ( Karabin2, ON )
SWITCH_GENERATOR ( ElektroPalce, ON )
SWITCH_GENERATOR ( ElektroArmata1, ON )
SWITCH_GENERATOR ( ElektroArmata2, ON )

//SKRYPT NA WSIADANIE DO WSPOLNEGO SAMOCHODU By DonMahone & Heri

WHILE_EXEC (loop = 1)

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX           TEAM 1        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// PROTECTION p2 EXIST //
IF ((CHECK_CHARACTER_HEALTH ( p2 , 0))
AND (CHECK_SCORE_GREATER ( p2 , -1)))
 STORE_CAR_CHARACTER_IS_IN ( p1 , p1_current_car )
 STORE_CAR_CHARACTER_IS_IN ( p2 , p2_current_car )
// DRIVER p1 // PASSENGER p2 //
 IF ((( IS_CHAR_PRESSING_HORN ( p1 )) 
 AND (NOT(IS_CHARACTER_IN_ANY_CAR ( p2 ))))
 AND (protect_team1 = 0))
  ++ horn_p1
 ENDIF
 IF (NOT(IS_CHAR_PRESSING_HORN ( p1 )))
  SET horn_p1 = 0
 ENDIF
 IF ((horn_p1 > 0)
 AND (horn_p1 < 11))
  ORDER_CHAR_TO_BACKDOOR ( p2 , p1_current_car)
  SET who_is_passanger_team1 = 2
 ENDIF
 // DRIVER p2 // PASSENGER p1 //
 IF ((( IS_CHAR_PRESSING_HORN ( p2 )) 
 AND ( NOT ( IS_CHARACTER_IN_ANY_CAR ( p1 ))))
 AND ( protect_team1 = 0 ))
  ++ horn_p2
 ENDIF
 IF ( NOT ( IS_CHAR_PRESSING_HORN ( p2 )))
  SET horn_p2 = 0
 ENDIF
 IF ((horn_p2 > 0)
 AND (horn_p2 < 11))
  ORDER_CHAR_TO_BACKDOOR ( p1 , p2_current_car) 
  SET who_is_passanger_team1 = 1
 ENDIF
 // KICK PLAYER FROM CAR//
 IF (( IS_CHARACTER_IN_CAR ( p2 , p1_current_car ))
 AND ( who_is_passanger_team1 = 2 ))
  IF (( IS_CHAR_PRESSING_HORN ( p1 )) 
  AND ( protect_team1 = 0 ))
   ORDER_DRIVER_OUT_CAR ( p2 )
   SET protect_team1 = 1
  ENDIF
 ENDIF 
 IF (( IS_CHARACTER_IN_CAR ( p1 , p2_current_car ))
 AND ( who_is_passanger_team1 = 1 ))
  IF (( IS_CHAR_PRESSING_HORN ( p2 )) 
  AND ( protect_team1 = 0 ))
   ORDER_DRIVER_OUT_CAR ( p1 )
   SET protect_team1 = 1
  ENDIF  
 ENDIF   
 IF (( protect_team1 = 1 )
 AND ( NOT( DELAY ( 30 ))))
  SET protect_team1 = 0
 ENDIF
ENDIF

// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX           TEAM 2        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXX                         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

// PROTECTION p3 and p4 EXIST //
IF ((((CHECK_CHARACTER_HEALTH ( p3 , 0))
AND (CHECK_SCORE_GREATER ( p3 , -1)))
AND (CHECK_CHARACTER_HEALTH ( p4 , 0)))
AND (CHECK_SCORE_GREATER ( p4 , -1)))
 STORE_CAR_CHARACTER_IS_IN ( p3 , p3_current_car )
 STORE_CAR_CHARACTER_IS_IN ( p4 , p4_current_car )
// DRIVER p3 // PASSENGER p4 //
 IF ((( IS_CHAR_PRESSING_HORN ( p3 )) 
 AND (NOT(IS_CHARACTER_IN_ANY_CAR ( p4 ))))
 AND (protect_team2 = 0))
  ++ horn_p3
 ENDIF
 IF (NOT(IS_CHAR_PRESSING_HORN ( p3 )))
  SET horn_p3 = 0
 ENDIF
 IF ((horn_p3 > 0)
 AND (horn_p3 < 11))
  ORDER_CHAR_TO_BACKDOOR ( p4 , p3_current_car)
  SET who_is_passanger_team2 = 2
 ENDIF
 // DRIVER p4 // PASSENGER p3 //
 IF ((( IS_CHAR_PRESSING_HORN ( p4 )) 
 AND ( NOT ( IS_CHARACTER_IN_ANY_CAR ( p3 ))))
 AND ( protect_team2 = 0 ))
  ++ horn_p4
 ENDIF
 IF ( NOT ( IS_CHAR_PRESSING_HORN ( p4 )))
  SET horn_p4 = 0
 ENDIF
 IF ((horn_p4 > 0)
 AND (horn_p4 < 11))
  ORDER_CHAR_TO_BACKDOOR ( p3 , p4_current_car) 
  SET who_is_passanger_team2 = 1
 ENDIF
 // KICK PLAYER FROM CAR//
 IF (( IS_CHARACTER_IN_CAR ( p4 , p3_current_car ))
 AND ( who_is_passanger_team2 = 2 ))
  IF (( IS_CHAR_PRESSING_HORN ( p3 )) 
  AND ( protect_team2 = 0 ))
   ORDER_DRIVER_OUT_CAR ( p4 )
   SET protect_team2 = 1
  ENDIF
 ENDIF 
 IF (( IS_CHARACTER_IN_CAR ( p3 , p4_current_car ))
 AND ( who_is_passanger_team2 = 1 ))
  IF (( IS_CHAR_PRESSING_HORN ( p4 )) 
  AND ( protect_team2 = 0 ))
   ORDER_DRIVER_OUT_CAR ( p3 )
   SET protect_team2 = 1
  ENDIF  
 ENDIF   
 IF (( protect_team2 = 1 )
 AND ( NOT( DELAY ( 30 ))))
  SET protect_team2 = 0
 ENDIF
ENDIF


ENDWHILE

LEVELEND

