//Rusztowanie by Areen

//Players
PLAYER_PED p1 = (009.5,020.5,3.0) 10 0 //Red
PLAYER_PED p2 = (014.5,012.5,5.0) 09 0 //Orange
PLAYER_PED p3 = (024.5,024.5,2.0) 07 0 //Yellow
PLAYER_PED p4 = (019.5,015.5,4.0) 11 0 //Green
PLAYER_PED p5 = (023.5,011.5,5.0) 13 0 //Dark Blue
PLAYER_PED p6 = (009.5,003.5,5.0) 08 0 //Black 

//Bonuses
GENERATOR health = (14.5,18.5,3.0) 0 collect_30 120 120
GENERATOR fr = (24.5,5.5,2.0) 0 collect_36 0 0 1
GENERATOR armour = (19.5,3.5,4.0) 0 collect_31 0 0 1
GENERATOR dd = (9.5,8.5,5.0) 0 collect_35 0 0 1

//Guns
GENERATOR zooka1 = (13.5,10.5,4.0) 0 collect_02 300 300 10
GENERATOR zooka2 = (13.5,20.5,5.0) 0 collect_02 300 300 10
GENERATOR zooka3 = (19.5,18.5,4.0) 0 collect_02 300 300 10
GENERATOR zooka4 = (16.5,6.5,4.0) 0 collect_02 300 300 10
GENERATOR mgun1 = (9.5,12.5,4.0) 0 collect_01 300 300 10
GENERATOR mgun2 = (18.5,22.5,3.0) 0 collect_01 300 300 10
GENERATOR mgun3 = (10.5,14.5,3.0) 0 collect_01 300 300 10
GENERATOR mgun4 = (10.5,7.5,4.0) 0 collect_01 300 300 10
GENERATOR ele = (14.5,13.5,5.0) 0 collect_03 300 300 10
GENERATOR molotov1 = (14.5,18.5,3.0) 0 collect_04 300 300 10
GENERATOR molotov2 = (13.5,23.5,3.0) 0 collect_04 300 300 10
GENERATOR molotov3 = (19.5,13.5,4.0) 0 collect_04 300 300 10
GENERATOR molotov4 = (24.0,22.0,3.0) 0 collect_04 300 300 10
GENERATOR grenade1 = (24.5,7.5,2.0) 0 collect_05 300 300 10
GENERATOR fl = (19.5,3.5,4.0) 0 collect_07 300 300 10

// Cars
CAR_DATA panto = (16.5,9.0) -1 000 FIAT
PARKED_CAR_DATA trailer = (1.0,1.0) 19 90 TRUKTRNS

// Code Looping:
COUNTER loopage = 1

//Gang
SET_GANG_INFO ( rgang , 5 , ROCKET_LAUNCHER , FLAME_THROWER , DUAL_PISTOL , 4 , 12.5 , 16.5 , 1.0 , 1 , PICKUP , 20 )
MAP_ZONE rgangzone = ( 1000 , 0 , 0 , 0 , 1000 , 0 , 0 , 0, 1000 , 0 , 100 )

LEVELSTART 

//Environment
SET_AMBIENT_LEVEL  (0.33,0)
SET_SHADING_LEVEL (20)
DECLARE_POLICELEVEL (4) //SWAT

//Gang respect
CHANGE_GANG_CHAR_RESPECT  ( rgang,  p1 , -5 )
CHANGE_GANG_CHAR_RESPECT  ( rgang,  p2 , -5 )
CHANGE_GANG_CHAR_RESPECT  ( rgang,  p3 , -5 )
CHANGE_GANG_CHAR_RESPECT  ( rgang,  p4 , -5 )
//CHANGE_GANG_CHAR_RESPECT  ( rgang,  p5 , -5 )
//CHANGE_GANG_CHAR_RESPECT  ( rgang,  p6 , -5 )

//Bonuses
SWITCH_GENERATOR (health, ON)
SWITCH_GENERATOR (fr, ON)
SWITCH_GENERATOR (armour, ON)
SWITCH_GENERATOR (dd, ON)

//Guns
SWITCH_GENERATOR (zooka1, ON)
SWITCH_GENERATOR (zooka2, ON)
SWITCH_GENERATOR (zooka3, ON)
SWITCH_GENERATOR (zooka4, ON)
SWITCH_GENERATOR (mgun1, ON)
SWITCH_GENERATOR (mgun2, ON)
SWITCH_GENERATOR (mgun3, ON)
SWITCH_GENERATOR (mgun4, ON)
SWITCH_GENERATOR (ele, ON)
SWITCH_GENERATOR (molotov1, ON)
SWITCH_GENERATOR (molotov2, ON)
SWITCH_GENERATOR (molotov3, ON)
SWITCH_GENERATOR (molotov4, ON)
SWITCH_GENERATOR (fl, ON)

// the loop
WHILE_EXEC (loopage = 1)

// Respawning Car:
IF (IS_CAR_WRECKED(panto))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(16.5,9.0,3.0)))
   IF (IS_CAR_IN_BLOCK(panto, 16.5,9.0,3.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (panto, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (panto)
   panto = CREATE_CAR (16.5,9.0) -1 000 FIAT END
   GIVE_WEAPON (panto, CAR_MACHINE_GUN, 99)
  ENDIF
 ENDIF
ENDIF
 
ENDWHILE

LEVELEND
