// 2007-02-27
// Name: Race for Rockets
// Script author: Sektor
// Map author: Mike - DMA Design
// Website: GTAMP.com

// Description:
// Uses Bonus Stage D (mike1e.gmp) - I just added more restart zones
// Both players start with unlimited rocket launcher ammo.
// If your opponent dies by any means then you lose your ammo.
// You can get it back by doing a lap or dying.
// First to frag limit wins!

// Feel free to use this code but please give credit to Sektor and link to GTAMP.com

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

PLAYER_PED P1 = (  102.5 , 104.6 , 3.0 ) 10  270
PLAYER_PED P2 = (  100.5 , 104.6 , 3.0 ) 6 90 // comment this line for 1 player
//CHAR_DATA P2 = ( 100.5 , 104.6 , 3.0 ) 6 90 DUMMY // uncomment this line for 1 player
COUNTER endlessloop = 1
COUNTER P1check1 = 0
COUNTER P1check2 = 0
COUNTER P2check1 = 0
COUNTER P2check2 = 0
COUNTER P1_has_lap_to_do = 0
COUNTER P2_has_lap_to_do = 0

CAR_DATA P1car
CAR_DATA P2car
PARKED_CAR_DATA parked_car_1 = ( 93.5 , 99.5 , 3.0 ) -1 75 copcar
PARKED_CAR_DATA parked_car_2 = ( 93.5 , 103.9 , 3.0 ) -1 105 copcar
PARKED_CAR_DATA parked_car_3 = ( 113.9 , 99.4 , 3.0 ) 22 105 spider
PARKED_CAR_DATA parked_car_4 = ( 127.0 , 90.0 , 3.0 ) 28 270 morris
PARKED_CAR_DATA parked_car_5 = ( 110.0 , 85.0 , 3.0 ) 15 180 GT24640
PARKED_CAR_DATA parked_car_6 = ( 102.5 , 75.0 , 3.0 ) 22 0 stingray
PARKED_CAR_DATA parked_car_7 = ( 91.5 , 75.0 , 3.0 ) 24 270 xk120
PARKED_CAR_DATA parked_car_8 = ( 87.5 , 83.0 , 3.0 ) 2 90 wbtwin
PARKED_CAR_DATA parked_car_9 = ( 81.5 , 88.0 , 3.0 ) 8 41 jeffrey
PARKED_CAR_DATA parked_car_10 = ( 85.2 , 97.8 , 3.0 ) 2 270 limo
PARKED_CAR_DATA parked_car_11 = ( 85.2 , 99.9 , 3.0 ) 33 270 limo
PARKED_CAR_DATA parked_car_12 = ( 85.0, 104.5 , 3.0 ) 29 133 graham
PARKED_CAR_DATA parked_car_13 = ( 88.0, 104.5 , 4.0 ) 30 90 buick
PARKED_CAR_DATA parked_car_14 = ( 95.5, 83.0 , 3.0 ) 270 133 edsel
PARKED_CAR_DATA parked_car_15 = ( 87.9, 99.1 , 4.0 ) 31 0 buick
PARKED_CAR_DATA parked_car_16 = ( 86.0, 115.0 , 3.0 ) 31 180 firetruk
PARKED_CAR_DATA parked_car_17 = ( 92.0, 115.0 , 3.0 ) 1 180 firetruk
PARKED_CAR_DATA parked_car_18 = ( 103.0, 1.0 , 3.0 ) 1 180 bus
PARKED_CAR_DATA parked_car_19 = ( 125.7 , 83.6 , 4.0 ) 2 270 GT24640

DECLARE_POLICELEVEL ( 5 )

LEVELSTART

// Make the Firetrucks rocketproof and give them flame cannons
SET_CAR_ROCKETPROOF ( parked_car_16 , ON )
SET_CAR_ROCKETPROOF ( parked_car_17 , ON )
GIVE_WEAPON ( parked_car_16 , CAR_FLAMETHROWER )
GIVE_WEAPON ( parked_car_17 , CAR_FLAMETHROWER )

P1car  =  CREATE_CAR ( 101.5, 98.5 , 3.0 ) 2 90 EDSEL END
P2car  =  CREATE_CAR ( 101.5, 105.5 , 3.0 ) 2 90 EDSEL END

WHILE_EXEC ( endlessloop = 1 )

IF ( HAS_CHARACTER_DIED ( P2 ))
   SET P1_has_lap_to_do = 1
   SET P2_has_lap_to_do = 0
   //P2 = CREATE_CHAR ( 101.5 , 104.6 , 3.0 ) 6 90 DUMMY END // uncomment this line for 1 player
ELSE
     GIVE_WEAPON ( P1, rocket_launcher, 99 )
ENDIF

IF ( HAS_CHARACTER_DIED ( P1 ))
   SET P2_has_lap_to_do = 1
   SET P1_has_lap_to_do = 0
ELSE
     GIVE_WEAPON ( P2, rocket_launcher, 99 )
ENDIF

IF ( P1_has_lap_to_do = 1 )
   REMOVE_WEAPONS ( P1 )
   IF ( LOCATE_CHARACTER_ANY_MEANS ( P1, 102.0, 102.0, 3.0, 1.0 , 5.0 ))
     SET P1check1 = 1
     IF ( P1check2 = 1 )
        SET P1_has_lap_to_do = 0
        SET P1check2 = 0
     ENDIF
   ENDIF

   IF ( LOCATE_CHARACTER_ANY_MEANS ( P1, 83.0, 95.0, 3.0, 10.0 , 1.0 ))
      IF ( P1check1 = 1 )
         SET P1check2 = 1
      ENDIF
   ENDIF
ENDIF

IF ( P2_has_lap_to_do = 1 )
   REMOVE_WEAPONS ( P2 )
   IF ( LOCATE_CHARACTER_ANY_MEANS ( P2, 102.0, 102.0, 3.0, 1.0 , 5.0 ))
     SET P2check1 = 1
     IF ( P2check2 = 1 )
        SET P2_has_lap_to_do = 0
        SET P2check2 = 0
     ENDIF
   ENDIF

   IF ( LOCATE_CHARACTER_ANY_MEANS ( P2, 83.0, 95.0, 3.0, 10.0 , 1.0 ))
      IF ( P2check1 = 1 )
         SET P2check2 = 1
      ENDIF
   ENDIF
ENDIF

ENDWHILE

LEVELEND
