/* Block Fort by wario5
modded by Sektor GTAMP.com 30/05/09 */

//Angles to help my poor memory
//	        N=180
//W=270--------|---------E=90
//            S=0

// PLAYERS
PLAYER_PED p1 = (112.0, 143.0, 2.0) 10  90
PLAYER_PED p2 = (113.0,  68.5, 2.0) 09   0
PLAYER_PED p3 = (136.5, 106.5, 2.0) 11 270
PLAYER_PED p4 = ( 87.5, 106.5, 2.0) 13  90
PLAYER_PED p5 = (139.5,  68.5, 2.0) 07   0
PLAYER_PED p6 = ( 85.5, 143.5, 2.0) 08 180

//MAP_ZONE name = ( cardensity , goodcarratio , bad car ratio , police car ratio , ped density , mugger ratio , car thief ratio , elvis ratio , gang char ratio , police ped ratio , gang car ratio)
MAP_ZONE cityinfo = ( 1 , 0, 0, 0 , 0 , 100 , 600 , 100, 100 , 100 , 0 )



//PARKED CARS
PARKED_CAR_DATA parked1 = ( 141.0 , 144.0 ) 2 270 BUICK
PARKED_CAR_DATA parked2 = ( 96.0 , 124.0 ) 2 270 BUICK
PARKED_CAR_DATA parked3 = ( 122.0 , 124.0 ) 2 25 BUICK
PARKED_CAR_DATA parked4 = ( 124.0 , 97.0 ) 2 25 EDSEL
PARKED_CAR_DATA parked5 = ( 127.0 , 80.0 ) 2 75 EDSEL
PARKED_CAR_DATA parked6 = ( 95.0 , 87.0 ) 2 270 EDSEL
PARKED_CAR_DATA parked7 = ( 130.0 , 125.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked8 = ( 95.0 , 133.0 ) 2 90 BUICK
PARKED_CAR_DATA parked9 = ( 128.0 , 88.0 ) 2 290 BUICK
PARKED_CAR_DATA parked10 = ( 96.5 , 138.5 ) 2 90 EDSEL
PARKED_CAR_DATA parked11 = ( 90.5 , 138.5 ) 2 90 EDSEL
PARKED_CAR_DATA parked12 = ( 127.5 , 133.5 ) 2 90 EDSEL
PARKED_CAR_DATA parked13 = ( 127.0 , 139.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked14 = ( 137.5 , 122.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked15 = ( 137.5 , 84.5 ) 2 0 EDSEL
PARKED_CAR_DATA parked16 = ( 129.5 , 68.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked17 = ( 122.5 , 68.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked18 = ( 85.0 , 67.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked19 = ( 98.1 , 67.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked20 = ( 97.5 , 80.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked21 = ( 111.1, 81.0 ) 2 0 EDSEL
PARKED_CAR_DATA parked22 = ( 84.1, 128.0 ) 2 0 BUICK
PARKED_CAR_DATA parked23 = ( 93.1, 126.0 ) 2 75 BUICK
PARKED_CAR_DATA parked24 = ( 93.0, 82.0 ) 2 65 BUICK
PARKED_CAR_DATA parked25 = ( 131.5, 86.5 ) 2 90 BUICK
PARKED_CAR_DATA parked26 = ( 122.5, 131.0 ) 2 270 BUICK

// POLICE
DECLARE_POLICELEVEL (5)

// SHOPS
OBJ_DATA srpayshop01 = ( 122.0 , 115.0 , 2.0 ) 0 car_shop  2 // black bottom right
OBJ_DATA sprayshop02 = ( 103.0 , 115.0 , 2.0 ) 0 car_shop  5 // green bottom left
OBJ_DATA sprayshop03 = ( 103.0 ,  97.0 , 2.0 ) 0 car_shop 10 // yellow top left
OBJ_DATA sprayshop04 = ( 122.0 ,  97.0 , 2.0 ) 0 car_shop 33 // white top right

// BARRICADES
OBJ_DATA BOLLARD1 = ( 131.5 , 134.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD2 = ( 131.5 , 135.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD3 = ( 133.5 , 132.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD4 = ( 134.5 , 132.5 , 4.0 ) 0 mine 

OBJ_DATA BOLLARD5 = ( 90.5 , 132.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD6 = ( 91.5 , 132.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD7 = ( 93.5 , 134.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD8 = ( 93.5 , 135.5 , 4.0 ) 90 mine 

OBJ_DATA BOLLARD9 = ( 90.5 , 79.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD10 = ( 91.5 , 79.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD11 = ( 93.5 , 76.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD12 = ( 93.5 , 77.5 , 4.0 ) 90 mine 

OBJ_DATA BOLLARD13 = ( 131.5 , 76.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD14 = ( 131.5 , 77.5 , 4.0 ) 90 mine 
OBJ_DATA BOLLARD15 = ( 133.5 , 79.5 , 4.0 ) 0 mine 
OBJ_DATA BOLLARD16 = ( 134.5 , 79.5 , 4.0 ) 0 mine 

// HEALTH
GENERATOR HEALTH01 = ( 83.5 , 106.5 ) 0 COLLECT_30 0 0 20 //left
GENERATOR HEALTH02 = ( 141.5 , 106.5 ) 0 COLLECT_30 0 0 20 //right
GENERATOR HEALTH03 = ( 112.5 , 67.5 ) 0 COLLECT_30 0 0 20 //top
GENERATOR HEALTH04 = ( 112.5 , 144.5 ) 0 COLLECT_30 0 0 20 //bottom
GENERATOR HEALTH05 = ( 112.5 , 106.5 ) 0 COLLECT_30 0 0 20 //center

// INSTANT GANGS
GENERATOR GANG01 = ( 87.5 , 71.5 ) 0 COLLECT_40 0 0 20 
GENERATOR GANG02 = ( 137.5 , 71.5 ) 0 COLLECT_40 0 0 20
GENERATOR GANG03 = ( 137.5 , 140.5 ) 0 COLLECT_40 0 0 20  
GENERATOR GANG04 = ( 87.5 , 140.5 ) 0 COLLECT_40 0 0 20 

// MACHINE GUNS
GENERATOR QUZI01 = ( 108.5 , 103.5 ) 0 COLLECT_09 3500 3500 10
GENERATOR QUZI02 = ( 98.0 , 73.0 ) 0 COLLECT_09 3500 3500 10
GENERATOR QUZI03 = ( 122.5 , 144.5 ) 0 COLLECT_09 3500 3500 10
GENERATOR QUZI04 = ( 137.5 , 91.5 ) 0 COLLECT_09 3500 3500 10
GENERATOR QUZI05 = ( 122.0 , 106.5 ) 0 COLLECT_09 3500 3500 10
GENERATOR QUZI06 = ( 103.0 , 106.5 ) 0 COLLECT_09 3500 3500 10

// EXPLOSIVES
GENERATOR MOLI01 = ( 122.5 , 92.5 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI02 = ( 122.5 , 120.5 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI03 = ( 102.5 , 120.5 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI04 = ( 102.5 , 92.5 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI05 = ( 112.5 , 84.5 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI06 = ( 126.0 , 101.0 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI07 = ( 112.5 , 97.0 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI08 = ( 112.5 , 115.0 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI09 = ( 112.5 , 131.0 ) 0 COLLECT_04 3500 3500 10
GENERATOR MOLI10 = ( 112.5 , 81.0 ) 0 COLLECT_04 3500 3500 10

GENERATOR GREN01 = ( 126.0 , 111.0 ) 0 COLLECT_05 3500 3500 15
GENERATOR GREN02 = ( 133.5 , 134.5 ) 0 COLLECT_05 3500 3500 15
GENERATOR GREN03 = ( 91.5 , 134.5 ) 0 COLLECT_05 3500 3500 15
GENERATOR GREN04 = ( 91.5 , 77.5 ) 0 COLLECT_05 3500 3500 15
GENERATOR GREN05 = ( 133.5 , 77.5 ) 0 COLLECT_05 3500 3500 15

// SHOTGUNS
GENERATOR SHOTGUN01 = ( 84.5 , 125.5 ) 0 COLLECT_06 3500 3500 20
GENERATOR SHOTGUN02 = ( 137.5 , 106.5 ) 0 COLLECT_06 3500 3500 20

COUNTER mainloop = 1

LEVELSTART

//SUPPRESS_THIS_CAR_MODEL (BOXCAR)
//SUPPRESS_THIS_CAR_MODEL (BUG2)
//SUPPRESS_THIS_CAR_MODEL (F250)
//SUPPRESS_THIS_CAR_MODEL (GT90)
//SUPPRESS_THIS_CAR_MODEL (SKYLINE)

// Maximum brightness:
SET_AMBIENT_LEVEL  (1.0, 0) 

// CARS
CAR_DATA p1car
CAR_DATA p2car
CAR_DATA p3car
CAR_DATA p4car
CAR_DATA p5car
CAR_DATA p6car

CAR_DATA p1startcar
CAR_DATA p2startcar
CAR_DATA p3startcar
CAR_DATA p4startcar
CAR_DATA p5startcar
CAR_DATA p6startcar

p1startcar = CREATE_CAR (112.5, 143.0) 17 180 EDSEL END // Red
p2startcar = CREATE_CAR (112.5,  68.5) 24   0 EDSEL END // Orange
p3startcar = CREATE_CAR ( 87.5, 106.0)  2  90 EDSEL END // Black
p4startcar = CREATE_CAR (139.5,  69.0) 35 270 EDSEL END // Yellow
p5startcar = CREATE_CAR ( 85.5, 143.0) 20  90 EDSEL END // Green
p6startcar = CREATE_CAR (136.5, 106.0)  2 270 EDSEL END // Black

PARKED_CAR_DATA trailer = (1.0,1.0) 19 90 TRUKTRNS

ADD_SCORE ( p1, 1000000 )
ADD_SCORE ( p2, 1000000 )
ADD_SCORE ( p3, 1000000 )
ADD_SCORE ( p4, 1000000 )
ADD_SCORE ( p5, 1000000 )
ADD_SCORE ( p6, 1000000 )

SWITCH_GENERATOR ( HEALTH01 , ON )
SWITCH_GENERATOR ( HEALTH02 , ON )
SWITCH_GENERATOR ( HEALTH03 , ON )
SWITCH_GENERATOR ( HEALTH04 , ON )
SWITCH_GENERATOR ( HEALTH05 , ON )

SWITCH_GENERATOR ( GANG01 , ON )
SWITCH_GENERATOR ( GANG02 , ON )
SWITCH_GENERATOR ( GANG03 , ON )
SWITCH_GENERATOR ( GANG04 , ON )

SWITCH_GENERATOR ( QUZI01 , ON )
SWITCH_GENERATOR ( QUZI02 , ON )
SWITCH_GENERATOR ( QUZI03 , ON )
SWITCH_GENERATOR ( QUZI04 , ON )
SWITCH_GENERATOR ( QUZI05 , ON )
SWITCH_GENERATOR ( QUZI06 , ON )

SWITCH_GENERATOR ( MOLI01 , ON )
SWITCH_GENERATOR ( MOLI02 , ON )
SWITCH_GENERATOR ( MOLI03 , ON )
SWITCH_GENERATOR ( MOLI04 , ON )
SWITCH_GENERATOR ( MOLI05 , ON )
SWITCH_GENERATOR ( MOLI06 , ON )
SWITCH_GENERATOR ( MOLI07 , ON )
SWITCH_GENERATOR ( MOLI08 , ON )
SWITCH_GENERATOR ( MOLI09 , ON )
SWITCH_GENERATOR ( MOLI10 , ON )

SWITCH_GENERATOR ( GREN01 , ON )
SWITCH_GENERATOR ( GREN02 , ON )
SWITCH_GENERATOR ( GREN03 , ON )
SWITCH_GENERATOR ( GREN04 , ON )
SWITCH_GENERATOR ( GREN05 , ON )

SWITCH_GENERATOR ( SHOTGUN01 , ON )
SWITCH_GENERATOR ( SHOTGUN02 , ON )

WHILE_EXEC ( mainloop = 1 )

// Respawning p1startcar
IF (IS_CAR_WRECKED(p1startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(112.5,143.0,2.0)))
   IF (IS_CAR_IN_BLOCK(p1startcar, 112.5,143.0,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p1startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p1startcar)
   p1startcar = CREATE_CAR (112.5, 143.0) 17 180 EDSEL END // Red
  ENDIF
 ENDIF
ENDIF

// Respawning p2startcar
IF (IS_CAR_WRECKED(p2startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(112.5,68.5,2.0)))
   IF (IS_CAR_IN_BLOCK(p2startcar, 112.5,68.5,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p2startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p2startcar)
   p2startcar = CREATE_CAR (112.5,  68.5) 24   0 EDSEL END // Orange
  ENDIF
 ENDIF
ENDIF

// Respawning p3startcar
IF (IS_CAR_WRECKED(p3startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(87.5,106.0,2.0)))
   IF (IS_CAR_IN_BLOCK(p3startcar, 87.5,106.0,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p3startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p3startcar)
   p3startcar = CREATE_CAR ( 87.5, 106.0)  2  90 EDSEL END // Black
  ENDIF
 ENDIF
ENDIF

// Respawning p4startcar
IF (IS_CAR_WRECKED(p4startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(139.5,69.0,2.0)))
   IF (IS_CAR_IN_BLOCK(p4startcar, 139.5,69.0,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p4startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p4startcar)
			p4startcar = CREATE_CAR (139.5,  69.0) 35 270 EDSEL END // Yellow
  ENDIF
 ENDIF
ENDIF

// Respawning p5startcar
IF (IS_CAR_WRECKED(p5startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(85.5,143.0,2.0)))
   IF (IS_CAR_IN_BLOCK(p5startcar, 85.5,143.0,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p5startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p5startcar)
			p5startcar = CREATE_CAR ( 85.5, 143.0) 20  90 EDSEL END // Green
  ENDIF
 ENDIF
ENDIF

// Respawning p6startcar
IF (IS_CAR_WRECKED(p6startcar))
 IF (NOT (DELAY (100))) // let explosion happen
  IF (NOT (IS_POINT_ONSCREEN(136.5,106.0,2.0)))
   IF (IS_CAR_IN_BLOCK(p6startcar, 136.5,106.0,2.0, 1.0,1.0))
    // Wreck is blocking spawnpoint:
    PUT_CAR_ON_TRAILER (p6startcar, trailer)
   ENDIF
   
   // Spawnpoint is clear:
   DELETE_ITEM (p6startcar)
			p6startcar = CREATE_CAR (136.5, 106.0)  2 270 EDSEL END // Black
  ENDIF
 ENDIF
ENDIF

 IF ( IS_CHARACTER_IN_ANY_CAR ( p1 ))
   STORE_CAR_CHARACTER_IS_IN ( p1, p1car )
   GIVE_WEAPON ( p1car, car_machine_gun, 99 )
 ENDIF

 IF ( IS_CHARACTER_IN_ANY_CAR ( p2 ))
   STORE_CAR_CHARACTER_IS_IN ( p2, p2car )
   GIVE_WEAPON ( p2car, car_machine_gun, 99 )
 ENDIF
	
	IF ( IS_CHARACTER_IN_ANY_CAR ( p3 ))
   STORE_CAR_CHARACTER_IS_IN ( p3, p3car )
   GIVE_WEAPON ( p3car, car_machine_gun, 99 )
 ENDIF
	
	IF ( IS_CHARACTER_IN_ANY_CAR ( p4 ))
   STORE_CAR_CHARACTER_IS_IN ( p4, p4car )
   GIVE_WEAPON ( p4car, car_machine_gun, 99 )
 ENDIF
	
	IF ( IS_CHARACTER_IN_ANY_CAR ( p5 ))
   STORE_CAR_CHARACTER_IS_IN ( p5, p5car )
   GIVE_WEAPON ( p5car, car_machine_gun, 99 )
 ENDIF
	
 IF ( IS_CHARACTER_IN_ANY_CAR ( p6 ))
   STORE_CAR_CHARACTER_IS_IN ( p6, p6car )
   GIVE_WEAPON ( p6car, car_machine_gun, 99 )
 ENDIF 
 
 GIVE_WEAPON ( p1, rocket_launcher , 99 ) 
 GIVE_WEAPON ( p1, flame_thrower , 99 ) 
 
 IF (CHECK_CHARACTER_HEALTH( p2, 0 ))
  GIVE_WEAPON ( p2, rocket_launcher, 99 ) 
  GIVE_WEAPON ( p2, flame_thrower , 99 ) 
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH( p3, 0 ))
  GIVE_WEAPON ( p3, rocket_launcher, 99 )
  GIVE_WEAPON ( p3, flame_thrower , 99 )  
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH( p4, 0 ))
  GIVE_WEAPON ( p4, rocket_launcher, 99 ) 
  GIVE_WEAPON ( p4, flame_thrower , 99 ) 
 ENDIF

 IF (CHECK_CHARACTER_HEALTH( p5, 0))
  GIVE_WEAPON ( p5, rocket_launcher, 99 ) 
  GIVE_WEAPON ( p5, flame_thrower , 99 ) 
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH( p6, 0 ))
  GIVE_WEAPON ( p6, rocket_launcher, 99 ) 
  GIVE_WEAPON ( p6, flame_thrower , 99 ) 
 ENDIF

ENDWHILE

LEVELEND
