Diablo

Материал из GTAModding.ru
Перейти к: навигация, поиск

Содержание

diablo1

MISSION_START
// *****************************************************************************************
// ***********************************    Diablo 1 	  **************************************
// *********************************** Low Rider Race **************************************
// *****************************************************************************************
// *** There will be a race to see who is the man. It will start at the top of the 		 ***
// *** bridge and encompass most of the industrial sector. The player must get to the 	 ***
// *** end before his three Hispanic rivals.											 ***
// *****************************************************************************************
 
// Mission start stuff
 
GOSUB mission_start_d1
 
IF HAS_DEATHARREST_BEEN_EXECUTED 
	GOSUB mission_d1_failed
ENDIF
 
GOSUB mission_cleanup_d1
 
MISSION_END
 
// Variables for mission
 
//VAR_INT	player_cpcounter_test//TEST VARS
VAR_FLOAT car1_x car1_y car1_z car2_x car2_y car2_z car3_x car3_y car3_z players_x players_y players_z
VAR_FLOAT difference_x_float_d difference_y_float_d	sum_difference_d_xy	ai_car1_locate_size ai_car2_locate_size ai_car3_locate_size
VAR_FLOAT car2_distance_from_cp car1_distance_from_cp car3_distance_from_cp players_distance_from_cp
VAR_FLOAT car1_stuck_x car1_stuck_y car1_stuck_z
VAR_FLOAT car2_stuck_x car2_stuck_y car2_stuck_z
VAR_FLOAT car3_stuck_x car3_stuck_y car3_stuck_z
VAR_FLOAT player_x_d1 player_y_d1 player_z_d1
VAR_FLOAT car1_x_d1 car1_y_d1 car1_z_d1
VAR_FLOAT car2_x_d1 car2_y_d1 car2_z_d1
VAR_FLOAT car3_x_d1 car3_y_d1 car3_z_d1
VAR_FLOAT blip_2nd_x blip_2nd_y blip_2nd_z
VAR_FLOAT cp2_x_d1 cp2_y_d1 cp2_z_d1
VAR_FLOAT cp3_x_d1 cp3_y_d1 cp3_z_d1
VAR_FLOAT cp4_x_d1 cp4_y_d1 cp4_z_d1
VAR_FLOAT cp5_x_d1 cp5_y_d1 cp5_z_d1
VAR_FLOAT cp6_x_d1 cp6_y_d1 cp6_z_d1
VAR_FLOAT cp7_x_d1 cp7_y_d1 cp7_z_d1
VAR_FLOAT cp8_x_d1 cp8_y_d1 cp8_z_d1
VAR_FLOAT cp9_x_d1 cp9_y_d1 cp9_z_d1
VAR_FLOAT cp10_x_d1 cp10_y_d1 cp10_z_d1
VAR_FLOAT cp11_x_d1 cp11_y_d1 cp11_z_d1
VAR_FLOAT cp12_x_d1 cp12_y_d1 cp12_z_d1
VAR_FLOAT cp13_x_d1 cp13_y_d1 cp13_z_d1
VAR_FLOAT cp14_x_d1 cp14_y_d1 cp14_z_d1
VAR_FLOAT cp15_x_d1 cp15_y_d1 cp15_z_d1
VAR_FLOAT cp16_x_d1 cp16_y_d1 cp16_z_d1
VAR_FLOAT cp17_x_d1 cp17_y_d1 cp17_z_d1
VAR_FLOAT cp18_x_d1 cp18_y_d1 cp18_z_d1												   //players_car_speed
VAR_INT blip_chase_d1 second_blip blip_car1_d1 blip_car2_d1 blip_car3_d1			   //players_car_speed_int
VAR_INT car1_d1 car2_d1 car3_d1 car1_health car2_health car3_health	
VAR_INT ped_car1_driver_d1 ped_car2_driver_d1 ped_car3_driver_d1
VAR_INT game_timer_start_d1 game_timer_end_d1 player_cpcounter car1_cpcounter car2_cpcounter car3_cpcounter
VAR_INT behind_car1 behind_car2 behind_car3 position timera_reset_flag_d1 timerb_reset_flag_d1  
VAR_INT timerc timerc_started timerc_current timerc_reset_flag_d1
VAR_INT timerd timerd_started timerd_current timerd_reset_flag
VAR_INT timere timere_started timere_current timere_reset_flag
VAR_INT timerf timerf_started timerf_current timerf_reset_flag
 
// ****************************************Mission Start************************************
 
mission_start_d1:
 
flag_player_on_mission = 1
flag_player_on_diablo_mission = 1
 
REGISTER_MISSION_GIVEN
 
WAIT 0
 
SCRIPT_NAME diablo1
 
game_timer_start_d1  = 0
game_timer_end_d1	 = 0
player_cpcounter 	 = 0
car1_cpcounter 	 	 = 0
car2_cpcounter 	 	 = 0
car3_cpcounter 		 = 0
behind_car1 		 = 0
behind_car2 		 = 0
behind_car3 	 	 = 0
position			 = 0
timera_reset_flag_d1 = 0
timerb_reset_flag_d1 = 0
timerc_reset_flag_d1 = 0
timerc_started 		 = 0
timerc_current 	 	 = 0
timerc				 = 0
timerd 				 = 0
timerd_started 		 = 0
timerd_current 	 	 = 0
timerd_reset_flag	 = 0
ai_car1_locate_size  = 7.0
ai_car2_locate_size  = 7.0
ai_car3_locate_size  = 7.0
timere_reset_flag = 0
timerf_reset_flag = 0
car1_stuck_x = 0.0
car1_stuck_y = 0.0
car1_stuck_z = 0.0
car2_stuck_x = 0.0
car2_stuck_y = 0.0
car2_stuck_z = 0.0
car3_stuck_x = 0.0
car3_stuck_y = 0.0
car3_stuck_z = 0.0
 
//_____________Check Points____________//
 
//cp1_x_d1 = 776.0
//cp1_y_d1 = -917.5
//cp1_z_d1 = 39.0
 
cp2_x_d1 =  1050.859
cp2_y_d1 =  -929.54
cp2_z_d1 =  14.4
 
cp3_x_d1 =  1314.0
cp3_y_d1 =  -945.0
cp3_z_d1 =  14.8
 
cp4_x_d1 =  1092.0
cp4_y_d1 =  -1061.0
cp4_z_d1 =  14.3
 
cp5_x_d1 =  842.0
cp5_y_d1 =  -1009.0
cp5_z_d1 =  4.4
 
cp6_x_d1 =  855.0
cp6_y_d1 =  -768.8
cp6_z_d1 =  14.6
 
cp7_x_d1 =  1004.0
cp7_y_d1 =  -822.0
cp7_z_d1 =  14.5
 
cp8_x_d1 =  1126.0
cp8_y_d1 =  -602.0
cp8_z_d1 =  14.4
 
cp9_x_d1 =  1196.0
cp9_y_d1 =  -254.0
cp9_z_d1 =  24.4
 
cp10_x_d1 = 1116.0
cp10_y_d1 = -14.0
cp10_z_d1 = 6.0
 
cp11_x_d1 = 934.0
cp11_y_d1 = -38.7
cp11_z_d1 = 7.0
 
cp12_x_d1 = 876.0
cp12_y_d1 = -131.0
cp12_z_d1 = 4.5
 
cp13_x_d1 = 870.0
cp13_y_d1 = -453.0
cp13_z_d1 = 14.4
 
cp14_x_d1 = 1049.0
cp14_y_d1 = -473.0
cp14_z_d1 = 14.4
 
cp15_x_d1 = 1337.0
cp15_y_d1 = -490.0
cp15_z_d1 = 46.0
 
cp16_x_d1 = 1337.0
cp16_y_d1 = -215.0
cp16_z_d1 = 45.4
 
cp17_x_d1 = 1048.0
cp17_y_d1 = -249.0
cp17_z_d1 = 5.0
 
cp18_x_d1 = 980.0
cp18_y_d1 = -565.0
cp18_z_d1 = 14.5
 
//______________________________________//
 
SET_PED_DENSITY_MULTIPLIER 0.0
CLEAR_AREA_OF_CHARS 890.3 -309.1 0.0 1038.1 -132.9 10.0
 
TIMERA = 0
 
/*
SET_FADING_COLOUR 0 0 0
 
DO_FADE 1500 FADE_OUT
 
//	SWITCH_STREAMING OFF
 
PRINT_BIG ( DIAB1 ) 15000 2 //"Diablo Mission 1"
 
IF CAN_PLAYER_START_MISSION Player
	MAKE_PLAYER_SAFE_FOR_CUTSCENE Player
ELSE
	GOTO mission_d1_failed
ENDIF
 
WHILE TIMERA < 1500					  
	WAIT 0
 
ENDWHILE
 
*/
 
LOAD_CUTSCENE EL_PH1
//SET_CUTSCENE_OFFSET 939.4 -230.1 3.9
SET_CUTSCENE_OFFSET 938.27 -229.561 4.023
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
DO_FADE 1500 FADE_IN
 
START_CUTSCENE
 
GET_CUTSCENE_TIME cs_time
 
WHILE cs_time < 2000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW DIAB1_B 10000 1 //"This is El Buro of the Diablos."
 
WHILE cs_time < 4731
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW DIAB1_D 10000 1 //"You're new in Liberty, but already you are gaining a reputation on the streets."
 
WHILE cs_time < 10501
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW DIAB1_E 10000 1 //"There's a street race starting by the old school hall near the Callahan Bridge."
 
WHILE cs_time < 15111
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW DIAB1_F 10000 1 //"Get yourself some wheels and first through all the checkpoints wins the prize."
 
WHILE cs_time < 20500
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
DO_FADE 1500 FADE_OUT
 
WHILE NOT HAS_CUTSCENE_FINISHED
	WAIT 0
ENDWHILE
 
CLEAR_PRINTS
SWITCH_STREAMING ON
 
WHILE GET_FADING_STATUS
	WAIT 0
ENDWHILE
 
CLEAR_CUTSCENE
SET_PED_DENSITY_MULTIPLIER 1.0
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
//____________________________________________________________________//
 
 
REQUEST_MODEL PED_GANG_DIABLO_A
REQUEST_MODEL PED_GANG_DIABLO_B
REQUEST_MODEL CAR_CHEETAH
 
WHILE NOT HAS_MODEL_LOADED CAR_CHEETAH
OR NOT HAS_MODEL_LOADED	PED_GANG_DIABLO_A
OR NOT HAS_MODEL_LOADED	PED_GANG_DIABLO_B
	WAIT 0
ENDWHILE
 
//WHILE NOT IS_BUTTON_PRESSED PAD1 LEFTSHOCK
//	WAIT 0
//ENDWHILE
 
SWITCH_ROADS_OFF 1034.0 -956.0 12.0 1063.0 -847.0 20.0
 
CREATE_CAR CAR_CHEETAH 1048.1465 -858.6693 13.7827 car1_d1
LOCK_CAR_DOORS car1_d1 CARLOCK_LOCKED
SET_CAR_PROOFS car1_d1 TRUE TRUE TRUE FALSE TRUE
SET_CAR_WATERTIGHT car1_d1 TRUE
SET_CAR_STRONG car1_d1 TRUE
SET_UPSIDEDOWN_CAR_NOT_DAMAGED car1_d1 TRUE
 
CREATE_CAR CAR_CHEETAH 1053.3384 -859.3337 13.7827 car2_d1
LOCK_CAR_DOORS car2_d1 CARLOCK_LOCKED
SET_CAR_PROOFS car2_d1 TRUE TRUE TRUE FALSE TRUE
SET_CAR_WATERTIGHT car2_d1 TRUE
SET_CAR_STRONG car2_d1 TRUE
SET_UPSIDEDOWN_CAR_NOT_DAMAGED car2_d1 TRUE
 
CREATE_CAR CAR_CHEETAH 1058.6385 -859.2989 13.7827 car3_d1
LOCK_CAR_DOORS car3_d1 CARLOCK_LOCKED
SET_CAR_PROOFS car3_d1 TRUE TRUE TRUE FALSE TRUE
SET_CAR_WATERTIGHT car3_d1 TRUE
SET_CAR_STRONG car3_d1 TRUE
SET_UPSIDEDOWN_CAR_NOT_DAMAGED car3_d1 TRUE
 
CREATE_CHAR_INSIDE_CAR car1_d1 PEDTYPE_CIVMALE PED_GANG_DIABLO_A ped_car1_driver_d1	
CREATE_CHAR_INSIDE_CAR car2_d1 PEDTYPE_CIVMALE PED_GANG_DIABLO_B ped_car2_driver_d1	
CREATE_CHAR_INSIDE_CAR car3_d1 PEDTYPE_CIVMALE PED_GANG_DIABLO_A ped_car3_driver_d1
 
SET_CHAR_CANT_BE_DRAGGED_OUT ped_car1_driver_d1 TRUE
SET_CHAR_CANT_BE_DRAGGED_OUT ped_car2_driver_d1 TRUE
SET_CHAR_CANT_BE_DRAGGED_OUT ped_car3_driver_d1 TRUE	
 
SET_CAR_HEADING car1_d1 180.0
SET_CAR_HEADING car2_d1 180.0
SET_CAR_HEADING car3_d1 180.0
 
CAR_SET_IDLE car1_d1
CAR_SET_IDLE car2_d1
CAR_SET_IDLE car3_d1
 
SET_CAR_DRIVING_STYLE car1_d1 2
SET_CAR_CRUISE_SPEED car1_d1 50.0
 
SET_CAR_DRIVING_STYLE car2_d1 2
SET_CAR_CRUISE_SPEED car2_d1 50.0
 
SET_CAR_DRIVING_STYLE car3_d1 2
SET_CAR_CRUISE_SPEED car3_d1 50.0
 
SET_CAR_ONLY_DAMAGED_BY_PLAYER car1_d1 TRUE
SET_CAR_ONLY_DAMAGED_BY_PLAYER car2_d1 TRUE
SET_CAR_ONLY_DAMAGED_BY_PLAYER car3_d1 TRUE
 
ADD_BLIP_FOR_COORD 1042.9772 -858.7398 13.7827 blip_chase_d1
 
PRINT_NOW DIAB1_4 5000 1 //"~g~Get a fast car and get to the starting grid."					
 
WHILE NOT LOCATE_STOPPED_PLAYER_IN_CAR_3D player 1042.9772 -858.7398 13.7827 2.0 2.0 2.0 1
 
	WAIT 0
 
	IF LOCATE_STOPPED_PLAYER_ON_FOOT_3D player 1042.9772 -858.7398 13.7827 2.0 2.0 2.0 1
		PRINT_NOW YD1_G 5000 1
	ENDIF
 
	IF IS_CAR_DEAD car1_d1
		GOTO mission_d1_failed
	ENDIF
 
	IF IS_CAR_DEAD car2_d1
		GOTO mission_d1_failed
	ENDIF
 
	IF IS_CAR_DEAD car3_d1
		GOTO mission_d1_failed
	ENDIF
 
	GET_CAR_HEALTH car1_d1 timerc
 
	IF timerc < 1000
		timerc = 9
		GOTO race_start
	ENDIF
 
	GET_CAR_HEALTH car2_d1 timerc
 
	IF timerc < 1000
		timerc = 9
		GOTO race_start
	ENDIF
 
	GET_CAR_HEALTH car3_d1 timerc
 
	IF timerc < 1000
		timerc = 9
		GOTO race_start
	ENDIF
 
//	IF IS_PLAYER_IN_ANY_CAR player
//		STORE_CAR_PLAYER_IS_IN player players_car
//		GET_CAR_SPEED players_car players_car_speed
//		players_car_speed_int =# players_car_speed
//		PRINT_WITH_NUMBER_NOW NUMBER players_car_speed_int 50 1
//	ENDIF
 
ENDWHILE
 
race_start:
 
SET_CAR_ONLY_DAMAGED_BY_PLAYER car1_d1 FALSE
SET_CAR_ONLY_DAMAGED_BY_PLAYER car2_d1 FALSE
SET_CAR_ONLY_DAMAGED_BY_PLAYER car3_d1 FALSE
 
IF timerc = 9
	PRINT_BIG DIAB1_1 1200 4 // "3..2..1.. GO GO GO!"
ELSE
	SET_PLAYER_CONTROL player OFF
	SET_EVERYONE_IGNORE_PLAYER player TRUE
	SET_ALL_CARS_CAN_BE_DAMAGED FALSE
	PRINT_BIG ( YD1_3 ) 1100 4
	ADD_ONE_OFF_SOUND 0.0 0.0 0.0 SOUND_RACE_START_3
	WAIT 1000
	PRINT_BIG ( YD1_2 ) 1100 4
	ADD_ONE_OFF_SOUND 0.0 0.0 0.0 SOUND_RACE_START_2
	WAIT 1000
	PRINT_BIG ( YD1_1 ) 1100 4
	ADD_ONE_OFF_SOUND 0.0 0.0 0.0 SOUND_RACE_START_1
	WAIT 1000
	PRINT_BIG ( YD1GO ) 800 4
	ADD_ONE_OFF_SOUND 0.0 0.0 0.0 SOUND_RACE_START_GO
	SET_PLAYER_CONTROL player ON
	SET_EVERYONE_IGNORE_PLAYER player FALSE
	SET_ALL_CARS_CAN_BE_DAMAGED TRUE
ENDIF
 
IF IS_CAR_DEAD car1_d1
	GOTO mission_d1_failed
ENDIF
 
IF IS_CAR_DEAD car2_d1
	GOTO mission_d1_failed
ENDIF
 
IF IS_CAR_DEAD car3_d1
	GOTO mission_d1_failed
ENDIF
 
timerc = 0
 
REMOVE_BLIP blip_chase_d1
 
ADD_BLIP_FOR_CAR_OLD car1_d1 RED MARKER_ONLY blip_car1_d1
ADD_BLIP_FOR_CAR_OLD car2_d1 RED MARKER_ONLY blip_car2_d1
ADD_BLIP_FOR_CAR_OLD car3_d1 RED MARKER_ONLY blip_car3_d1
 
player_x_d1 = cp2_x_d1
player_y_d1 = cp2_y_d1
player_z_d1 = cp2_z_d1
blip_2nd_x = cp3_x_d1
blip_2nd_y = cp3_y_d1
blip_2nd_z = cp3_z_d1
 
car1_x_d1 = cp2_x_d1
car1_y_d1 = cp2_y_d1
car1_z_d1 = cp2_z_d1
 
car2_x_d1 = cp2_x_d1
car2_y_d1 = cp2_y_d1
car2_z_d1 = cp2_z_d1
 
car3_x_d1 = cp2_x_d1
car3_y_d1 = cp2_y_d1
car3_z_d1 = cp2_z_d1
 
ADD_BLIP_FOR_COORD player_x_d1 player_y_d1 player_z_d1 blip_chase_d1
ADD_BLIP_FOR_COORD_OLD blip_2nd_x blip_2nd_y blip_2nd_z PURPLE BLIP_ONLY second_blip
CHANGE_BLIP_SCALE second_blip 2
DIM_BLIP second_blip TRUE
CAR_GOTO_COORDINATES car1_d1 car1_x_d1 car1_y_d1 car1_z_d1
CAR_GOTO_COORDINATES car2_d1 car2_x_d1 car2_y_d1 car2_z_d1
CAR_GOTO_COORDINATES car3_d1 car3_x_d1 car3_y_d1 car3_z_d1
 
GET_GAME_TIMER game_timer_start_d1
GET_GAME_TIMER game_timer_end_d1
game_timer_end_d1 = game_timer_end_d1 - game_timer_start_d1
game_timer_end_d1 = game_timer_end_d1 / 1000
DISPLAY_ONSCREEN_COUNTER_WITH_STRING game_timer_end_d1 COUNTER_DISPLAY_NUMBER DIAB1_5
 
 
loop1:
 
WAIT 0
 
GET_GAME_TIMER game_timer_end_d1
game_timer_end_d1 = game_timer_end_d1 - game_timer_start_d1
game_timer_end_d1 = game_timer_end_d1 / 1000
 
position = 0 + behind_car1 
position += behind_car2 
position += behind_car3
 
IF position = 0
	PRINT_NOW FIRST 100 1 //"1st"
ENDIF
 
IF position = 1
	PRINT_NOW SECOND 100 1 //"2nd"
ENDIF
 
IF position = 2
	PRINT_NOW THIRD 100 1 //"3rd"
ENDIF
 
IF position = 3
	PRINT_NOW FOURTH 100 1 //"4th"
ENDIF
 
IF player_cpcounter = 17
	DRAW_CORONA player_x_d1 player_y_d1 player_z_d1 5.5 CORONATYPE_CIRCLE FLARETYPE_NONE 100 0 0
ELSE
	DRAW_CORONA player_x_d1 player_y_d1 player_z_d1 5.5 CORONATYPE_CIRCLE FLARETYPE_NONE 0 0 100
ENDIF
 
IF LOCATE_PLAYER_IN_CAR_3D player player_x_d1 player_y_d1 player_z_d1 6.0 6.0 6.0 0
 
	++ player_cpcounter
 
	REMOVE_BLIP blip_chase_d1
	REMOVE_BLIP second_blip
 
	IF player_cpcounter = 1
		player_x_d1 = cp3_x_d1
		player_y_d1 = cp3_y_d1
		player_z_d1 = cp3_z_d1
		blip_2nd_x = cp4_x_d1
		blip_2nd_y = cp4_y_d1
		blip_2nd_z = cp4_z_d1
	ENDIF
 
	IF player_cpcounter = 2
		player_x_d1 = cp4_x_d1
		player_y_d1 = cp4_y_d1
		player_z_d1 = cp4_z_d1
		blip_2nd_x = cp5_x_d1
		blip_2nd_y = cp5_y_d1
		blip_2nd_z = cp5_z_d1
	ENDIF
 
	IF player_cpcounter = 3
		player_x_d1 = cp5_x_d1
		player_y_d1 = cp5_y_d1
		player_z_d1 = cp5_z_d1
		blip_2nd_x = cp6_x_d1
		blip_2nd_y = cp6_y_d1
		blip_2nd_z = cp6_z_d1
	ENDIF
 
	IF player_cpcounter = 4
		player_x_d1 = cp6_x_d1
		player_y_d1 = cp6_y_d1
		player_z_d1 = cp6_z_d1
		blip_2nd_x = cp7_x_d1
		blip_2nd_y = cp7_y_d1
		blip_2nd_z = cp7_z_d1
	ENDIF
 
	IF player_cpcounter = 5
		player_x_d1 = cp7_x_d1
		player_y_d1 = cp7_y_d1
		player_z_d1 = cp7_z_d1
		blip_2nd_x = cp8_x_d1
		blip_2nd_y = cp8_y_d1
		blip_2nd_z = cp8_z_d1
	ENDIF
 
	IF player_cpcounter = 6
		player_x_d1 = cp8_x_d1
		player_y_d1 = cp8_y_d1
		player_z_d1 = cp8_z_d1
		blip_2nd_x = cp9_x_d1
		blip_2nd_y = cp9_y_d1
		blip_2nd_z = cp9_z_d1
	ENDIF
 
	IF player_cpcounter = 7
		player_x_d1 = cp9_x_d1
		player_y_d1 = cp9_y_d1
		player_z_d1 = cp9_z_d1
		blip_2nd_x = cp10_x_d1
		blip_2nd_y = cp10_y_d1
		blip_2nd_z = cp10_z_d1
	ENDIF
 
	IF player_cpcounter = 8
		player_x_d1 = cp10_x_d1
		player_y_d1 = cp10_y_d1
		player_z_d1 = cp10_z_d1
		blip_2nd_x = cp11_x_d1
		blip_2nd_y = cp11_y_d1
		blip_2nd_z = cp11_z_d1
	ENDIF
 
	IF player_cpcounter = 9
		player_x_d1 = cp11_x_d1
		player_y_d1 = cp11_y_d1
		player_z_d1 = cp11_z_d1
		blip_2nd_x = cp12_x_d1
		blip_2nd_y = cp12_y_d1
		blip_2nd_z = cp12_z_d1
	ENDIF
 
	IF player_cpcounter = 10
		player_x_d1 = cp12_x_d1
		player_y_d1 = cp12_y_d1
		player_z_d1 = cp12_z_d1
		blip_2nd_x = cp13_x_d1
		blip_2nd_y = cp13_y_d1
		blip_2nd_z = cp13_z_d1
	ENDIF
 
	IF player_cpcounter = 11
		player_x_d1 = cp13_x_d1
		player_y_d1 = cp13_y_d1
		player_z_d1 = cp13_z_d1
		blip_2nd_x = cp14_x_d1
		blip_2nd_y = cp14_y_d1
		blip_2nd_z = cp14_z_d1
	ENDIF
 
	IF player_cpcounter = 12
		player_x_d1 = cp14_x_d1
		player_y_d1 = cp14_y_d1
		player_z_d1 = cp14_z_d1
		blip_2nd_x = cp15_x_d1
		blip_2nd_y = cp15_y_d1
		blip_2nd_z = cp15_z_d1
	ENDIF
 
	IF player_cpcounter = 13
		player_x_d1 = cp15_x_d1
		player_y_d1 = cp15_y_d1
		player_z_d1 = cp15_z_d1
		blip_2nd_x = cp16_x_d1
		blip_2nd_y = cp16_y_d1
		blip_2nd_z = cp16_z_d1
	ENDIF
 
	IF player_cpcounter = 14
		player_x_d1 = cp16_x_d1
		player_y_d1 = cp16_y_d1
		player_z_d1 = cp16_z_d1
		blip_2nd_x = cp17_x_d1
		blip_2nd_y = cp17_y_d1
		blip_2nd_z = cp17_z_d1
	ENDIF
 
	IF player_cpcounter = 15
		player_x_d1 = cp17_x_d1
		player_y_d1 = cp17_y_d1
		player_z_d1 = cp17_z_d1
		blip_2nd_x = cp18_x_d1
		blip_2nd_y = cp18_y_d1
		blip_2nd_z = cp18_z_d1
	ENDIF
 
	IF player_cpcounter = 16
		player_x_d1 = cp18_x_d1
		player_y_d1 = cp18_y_d1
		player_z_d1 = cp18_z_d1
		blip_2nd_x = cp2_x_d1
		blip_2nd_y = cp2_y_d1
		blip_2nd_z = cp2_z_d1
	ENDIF
 
	IF player_cpcounter = 17
		player_x_d1 = cp2_x_d1
		player_y_d1 = cp2_y_d1
		player_z_d1 = cp2_z_d1
		blip_2nd_x = cp2_x_d1
		blip_2nd_y = cp2_y_d1
		blip_2nd_z = cp2_z_d1
	ENDIF
 
	IF player_cpcounter = 18
//	AND	position = 0
		GOTO mission_d1_passed		
	ENDIF
 
	ADD_BLIP_FOR_COORD_OLD blip_2nd_x blip_2nd_y blip_2nd_z PURPLE BLIP_ONLY second_blip
	DIM_BLIP second_blip ON
	CHANGE_BLIP_SCALE second_blip 2
	ADD_BLIP_FOR_COORD player_x_d1 player_y_d1 player_z_d1 blip_chase_d1
 
ENDIF
 
IF NOT IS_CAR_DEAD car1_d1
 
	GET_CAR_HEALTH car1_d1 car1_health
	IF car1_health < 500
		SET_CAR_HEALTH car1_d1 1000
	ENDIF
 
	IF NOT player_cpcounter	= car1_cpcounter
		IF player_cpcounter < car1_cpcounter
			behind_car1 = 1
		ELSE
			behind_car1 = 0
		ENDIF  
	ELSE
		GET_CAR_COORDINATES	car1_d1 car1_x car1_y car1_z
		difference_x_float_d = car1_x - player_x_d1
		difference_y_float_d = car1_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy car1_distance_from_cp
 
		GET_PLAYER_COORDINATES player players_x players_y players_z
		difference_x_float_d = players_x - player_x_d1
		difference_y_float_d = players_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy players_distance_from_cp
 
		IF players_distance_from_cp < car1_distance_from_cp
			behind_car1 = 0
		ELSE
			behind_car1 = 1
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car1_d1 car1_stuck_x car1_stuck_y car1_stuck_z 4.0 4.0 4.0 0
		IF timerd_reset_flag = 0
			GET_GAME_TIMER timerd_started
			timerd_reset_flag = 1
		ENDIF
 
		IF timerd_reset_flag = 1
			GET_GAME_TIMER timerd_current
			timerd = timerd_current - timerd_started
			IF timerd > 8000
				IF NOT IS_CAR_ON_SCREEN car1_d1
					GET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
					GET_CLOSEST_CAR_NODE car1_x car1_y car1_z car1_x car1_y car1_z
					IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car1_x car1_y car1_z 4.0 4.0 4.0
						IF NOT IS_POINT_ON_SCREEN car1_x car1_y car1_z 4.0
							SET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
							TURN_CAR_TO_FACE_COORD car1_d1 car1_x_d1 car1_y_d1
							timerd_reset_flag = 0
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF NOT LOCATE_CAR_3D car1_d1 car1_stuck_x car1_stuck_y car1_stuck_z 4.0 4.0 4.0 0
		GET_CAR_COORDINATES car1_d1 car1_stuck_x car1_stuck_y car1_stuck_z
		timerd_reset_flag = 0
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN car1_d1
	AND IS_CAR_STOPPED car1_d1
		IF NOT IS_CAR_ON_SCREEN car1_d1
			GET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
			GET_CLOSEST_CAR_NODE car1_x car1_y car1_z car1_x car1_y car1_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car1_x car1_y car1_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car1_x car1_y car1_z 3.0
					SET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
					TURN_CAR_TO_FACE_COORD car1_d1 car1_x_d1 car1_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF timera_reset_flag_d1 = 1
		IF NOT IS_CAR_STOPPED car1_d1
			timera_reset_flag_d1 = 0
		ENDIF
	ENDIF
 
	IF IS_CAR_STOPPED car1_d1
		IF timera_reset_flag_d1 = 0
			TIMERA = 0
			timera_reset_flag_d1 = 1
		ENDIF
 
		IF TIMERA > 5000
		AND timera_reset_flag_d1 = 1
			IF NOT IS_CAR_ON_SCREEN car1_d1
				GET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
				GET_CLOSEST_CAR_NODE car1_x car1_y car1_z car1_x car1_y car1_z
				IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car1_x car1_y car1_z 4.0 4.0 4.0
					IF NOT IS_POINT_ON_SCREEN car1_x car1_y car1_z 4.0
						SET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
						TURN_CAR_TO_FACE_COORD car1_d1 car1_x_d1 car1_y_d1
						timera_reset_flag_d1 = 0
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car1_d1 car1_x_d1 car1_y_d1 car1_z_d1 ai_car1_locate_size ai_car1_locate_size ai_car1_locate_size 0
		++ car1_cpcounter
 
		IF car1_cpcounter = 1
			car1_x_d1 = cp3_x_d1
			car1_y_d1 = cp3_y_d1
			car1_z_d1 = cp3_z_d1
		ENDIF
 
		IF car1_cpcounter = 2
			car1_x_d1 = cp4_x_d1
			car1_y_d1 = cp4_y_d1
			car1_z_d1 = cp4_z_d1
			SWITCH_ROADS_ON 1034.0 -956.0 12.0 1063.0 -847.0 20.0
		ENDIF
 
		IF car1_cpcounter = 3
			car1_x_d1 = cp5_x_d1
			car1_y_d1 = cp5_y_d1
			car1_z_d1 = cp5_z_d1
		ENDIF
 
		IF car1_cpcounter = 4
			car1_x_d1 = cp6_x_d1
			car1_y_d1 = cp6_y_d1
			car1_z_d1 = cp6_z_d1
		ENDIF
 
		IF car1_cpcounter = 5
			car1_x_d1 = cp7_x_d1
			car1_y_d1 = cp7_y_d1
			car1_z_d1 = cp7_z_d1
		ENDIF
 
		IF car1_cpcounter = 6
			car1_x_d1 = cp8_x_d1
			car1_y_d1 = cp8_y_d1
			car1_z_d1 = cp8_z_d1
		ENDIF
 
		IF car1_cpcounter = 7
			car1_x_d1 = cp9_x_d1
			car1_y_d1 = cp9_y_d1
			car1_z_d1 = cp9_z_d1
		ENDIF
 
		IF car1_cpcounter = 8
			car1_x_d1 = cp10_x_d1
			car1_y_d1 = cp10_y_d1
			car1_z_d1 = cp10_z_d1
		ENDIF
 
		IF car1_cpcounter = 9
			car1_x_d1 = cp11_x_d1
			car1_y_d1 = cp11_y_d1
			car1_z_d1 = cp11_z_d1
		ENDIF
 
		IF car1_cpcounter = 10
			car1_x_d1 = cp12_x_d1
			car1_y_d1 = cp12_y_d1
			car1_z_d1 = cp12_z_d1
		ENDIF
 
		IF car1_cpcounter = 11
			car1_x_d1 = cp13_x_d1
			car1_y_d1 = cp13_y_d1
			car1_z_d1 = cp13_z_d1
		ENDIF
 
		IF car1_cpcounter = 12
			car1_x_d1 = cp14_x_d1
			car1_y_d1 = cp14_y_d1
			car1_z_d1 = cp14_z_d1
		ENDIF
 
		IF car1_cpcounter = 13
			car1_x_d1 = cp15_x_d1
			car1_y_d1 = cp15_y_d1
			car1_z_d1 = cp15_z_d1
		ENDIF
 
		IF car1_cpcounter = 14
			car1_x_d1 = cp16_x_d1
			car1_y_d1 = cp16_y_d1
			car1_z_d1 = cp16_z_d1
		ENDIF
 
		IF car1_cpcounter = 15
			car1_x_d1 = cp17_x_d1
			car1_y_d1 = cp17_y_d1
			car1_z_d1 = cp17_z_d1
		ENDIF
 
		IF car1_cpcounter = 16
			car1_x_d1 = cp18_x_d1
			car1_y_d1 = cp18_y_d1
			car1_z_d1 = cp18_z_d1
		ENDIF
 
		IF car1_cpcounter = 17
			car1_x_d1 = cp2_x_d1
			car1_y_d1 = cp2_y_d1
			car1_z_d1 = cp2_z_d1
			ai_car1_locate_size = 6.0
		ENDIF
 
		IF car1_cpcounter = 18
//		AND	position > 0
			PRINT_NOW DIAB1_3 5000 1 //"~r~You failed to win the race!"
			GOTO mission_d1_failed		
		ENDIF
 
		IF ai_car1_locate_size = 7.0
			CAR_GOTO_COORDINATES car1_d1 car1_x_d1 car1_y_d1 car1_z_d1
		ELSE
			CAR_GOTO_COORDINATES_ACCURATE car1_d1 car1_x_d1 car1_y_d1 car1_z_d1
		ENDIF
 
	ENDIF
ELSE
 
	IF NOT IS_CAR_IN_WATER car1_d1
		behind_car1 = 0
		car1_cpcounter	= 0
	ENDIF
 
	IF IS_CAR_IN_WATER car1_d1
		IF NOT IS_CAR_ON_SCREEN car1_d1
			GET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
			GET_CLOSEST_CAR_NODE car1_x car1_y car1_z car1_x car1_y car1_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car1_x car1_y car1_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car1_x car1_y car1_z 3.0
					SET_CAR_COORDINATES car1_d1 car1_x car1_y car1_z
					TURN_CAR_TO_FACE_COORD car1_d1 car1_x_d1 car1_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
ENDIF
 
IF NOT IS_CAR_DEAD car2_d1
 
	GET_CAR_HEALTH car2_d1 car2_health
	IF car2_health < 500
		SET_CAR_HEALTH car2_d1 1000
	ENDIF
 
	IF NOT player_cpcounter	= car2_cpcounter	
		IF player_cpcounter < car2_cpcounter
			behind_car2 = 1
		ELSE
			behind_car2 = 0
		ENDIF
	ELSE
		GET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
		difference_x_float_d = car2_x - player_x_d1
		difference_y_float_d = car2_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy car2_distance_from_cp
 
		GET_PLAYER_COORDINATES player players_x players_y players_z
		difference_x_float_d = players_x - player_x_d1
		difference_y_float_d = players_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy players_distance_from_cp
 
		IF players_distance_from_cp < car2_distance_from_cp
			behind_car2 = 0
		ELSE
			behind_car2 = 1
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car2_d1 car2_stuck_x car2_stuck_y car2_stuck_z 4.0 4.0 4.0 0
		IF timere_reset_flag = 0
			GET_GAME_TIMER timere_started
			timere_reset_flag = 1
		ENDIF
 
		IF timere_reset_flag = 1
			GET_GAME_TIMER timere_current
			timere = timere_current - timere_started
			IF timere > 8000
				IF NOT IS_CAR_ON_SCREEN car2_d1
					GET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
					GET_CLOSEST_CAR_NODE car2_x car2_y car2_z car2_x car2_y car2_z
					IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car2_x car2_y car2_z 4.0 4.0 4.0
						IF NOT IS_POINT_ON_SCREEN car2_x car2_y car2_z 4.0
							SET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
							TURN_CAR_TO_FACE_COORD car2_d1 car2_x_d1 car2_y_d1
							timere_reset_flag = 0
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF NOT LOCATE_CAR_3D car2_d1 car2_stuck_x car2_stuck_y car2_stuck_z 4.0 4.0 4.0 0
		GET_CAR_COORDINATES car2_d1 car2_stuck_x car2_stuck_y car2_stuck_z
		timere_reset_flag = 0
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN car2_d1
	AND IS_CAR_STOPPED car2_d1
		IF NOT IS_CAR_ON_SCREEN car2_d1
			GET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
			GET_CLOSEST_CAR_NODE car2_x car2_y car2_z car2_x car2_y car2_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car2_x car2_y car2_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car2_x car2_y car2_z 3.0
					SET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
					TURN_CAR_TO_FACE_COORD car2_d1 car2_x_d1 car2_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF timerb_reset_flag_d1 = 1
		IF NOT IS_CAR_STOPPED car2_d1
			timerb_reset_flag_d1 = 0
		ENDIF
	ENDIF
 
	IF IS_CAR_STOPPED car2_d1
		IF timerb_reset_flag_d1 = 0
			TIMERB = 0
			timerb_reset_flag_d1 = 1
		ENDIF
 
		IF TIMERB > 5000
		AND timerb_reset_flag_d1 = 1
			IF NOT IS_CAR_ON_SCREEN car2_d1
				GET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
				GET_CLOSEST_CAR_NODE car2_x car2_y car2_z car2_x car2_y car2_z
				IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car2_x car2_y car2_z 4.0 4.0 4.0
					IF NOT IS_POINT_ON_SCREEN car2_x car2_y car2_z 4.0
						SET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
						TURN_CAR_TO_FACE_COORD car2_d1 car2_x_d1 car2_y_d1
						timerb_reset_flag_d1 = 0
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car2_d1 car2_x_d1 car2_y_d1 car2_z_d1 ai_car2_locate_size ai_car2_locate_size ai_car2_locate_size 0
		++ car2_cpcounter
 
		IF car2_cpcounter = 1
			car2_x_d1 = cp3_x_d1
			car2_y_d1 = cp3_y_d1
			car2_z_d1 = cp3_z_d1
		ENDIF
 
		IF car2_cpcounter = 2
			car2_x_d1 = cp4_x_d1
			car2_y_d1 = cp4_y_d1
			car2_z_d1 = cp4_z_d1
		ENDIF
 
		IF car2_cpcounter = 3
			car2_x_d1 = cp5_x_d1
			car2_y_d1 = cp5_y_d1
			car2_z_d1 = cp5_z_d1
		ENDIF
 
		IF car2_cpcounter = 4
			car2_x_d1 = cp6_x_d1
			car2_y_d1 = cp6_y_d1
			car2_z_d1 = cp6_z_d1
		ENDIF
 
		IF car2_cpcounter = 5
			car2_x_d1 = cp7_x_d1
			car2_y_d1 = cp7_y_d1
			car2_z_d1 = cp7_z_d1
		ENDIF
 
		IF car2_cpcounter = 6
			car2_x_d1 = cp8_x_d1
			car2_y_d1 = cp8_y_d1
			car2_z_d1 = cp8_z_d1
		ENDIF
 
		IF car2_cpcounter = 7
			car2_x_d1 = cp9_x_d1
			car2_y_d1 = cp9_y_d1
			car2_z_d1 = cp9_z_d1
		ENDIF
 
		IF car2_cpcounter = 8
			car2_x_d1 = cp10_x_d1
			car2_y_d1 = cp10_y_d1
			car2_z_d1 = cp10_z_d1
		ENDIF
 
		IF car2_cpcounter = 9
			car2_x_d1 = cp11_x_d1
			car2_y_d1 = cp11_y_d1
			car2_z_d1 = cp11_z_d1
		ENDIF
 
		IF car2_cpcounter = 10
			car2_x_d1 = cp12_x_d1
			car2_y_d1 = cp12_y_d1
			car2_z_d1 = cp12_z_d1
		ENDIF
 
		IF car2_cpcounter = 11
			car2_x_d1 = cp13_x_d1
			car2_y_d1 = cp13_y_d1
			car2_z_d1 = cp13_z_d1
		ENDIF
 
		IF car2_cpcounter = 12
			car2_x_d1 = cp14_x_d1
			car2_y_d1 = cp14_y_d1
			car2_z_d1 = cp14_z_d1
		ENDIF
 
		IF car2_cpcounter = 13
			car2_x_d1 = cp15_x_d1
			car2_y_d1 = cp15_y_d1
			car2_z_d1 = cp15_z_d1
		ENDIF
 
		IF car2_cpcounter = 14
			car2_x_d1 = cp16_x_d1
			car2_y_d1 = cp16_y_d1
			car2_z_d1 = cp16_z_d1
		ENDIF
 
		IF car2_cpcounter = 15
			car2_x_d1 = cp17_x_d1
			car2_y_d1 = cp17_y_d1
			car2_z_d1 = cp17_z_d1
		ENDIF
 
		IF car2_cpcounter = 16
			car2_x_d1 = cp18_x_d1
			car2_y_d1 = cp18_y_d1
			car2_z_d1 = cp18_z_d1
		ENDIF
 
		IF car2_cpcounter = 17
			car2_x_d1 = cp2_x_d1
			car2_y_d1 = cp2_y_d1
			car2_z_d1 = cp2_z_d1
			ai_car2_locate_size = 6.0
		ENDIF
 
		IF car2_cpcounter = 18
//		AND	position > 0
			PRINT_NOW DIAB1_3 5000 1 //"~r~You failed to win the race!"
			GOTO mission_d1_failed		
		ENDIF
 
		IF ai_car2_locate_size = 7.0
			CAR_GOTO_COORDINATES car2_d1 car2_x_d1 car2_y_d1 car2_z_d1
		ELSE
			CAR_GOTO_COORDINATES_ACCURATE car2_d1 car2_x_d1 car2_y_d1 car2_z_d1
		ENDIF
 
	ENDIF
ELSE
 
	IF NOT IS_CAR_IN_WATER car2_d1
		behind_car2 = 0
		car2_cpcounter = 0
	ENDIF
 
	IF IS_CAR_IN_WATER car2_d1
		IF NOT IS_CAR_ON_SCREEN car2_d1
			GET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
			GET_CLOSEST_CAR_NODE car2_x car2_y car2_z car2_x car2_y car2_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car2_x car2_y car2_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car2_x car2_y car2_z 3.0
					SET_CAR_COORDINATES car2_d1 car2_x car2_y car2_z
					TURN_CAR_TO_FACE_COORD car2_d1 car2_x_d1 car2_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
ENDIF
 
IF NOT IS_CAR_DEAD car3_d1
 
	GET_CAR_HEALTH car3_d1 car3_health
	IF car3_health < 500
		SET_CAR_HEALTH car3_d1 1000
	ENDIF
 
	IF NOT player_cpcounter	= car3_cpcounter	
		IF player_cpcounter < car3_cpcounter
			behind_car3 = 1
		ELSE
			behind_car3 = 0
		ENDIF
	ELSE
		GET_CAR_COORDINATES	car3_d1 car3_x car3_y car3_z
		difference_x_float_d = car3_x - player_x_d1
		difference_y_float_d = car3_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy car3_distance_from_cp
 
		GET_PLAYER_COORDINATES player players_x players_y players_z
		difference_x_float_d = players_x - player_x_d1
		difference_y_float_d = players_y - player_y_d1
		difference_x_float_d = difference_x_float_d * difference_x_float_d
		difference_y_float_d = difference_y_float_d * difference_y_float_d
		sum_difference_d_xy = difference_x_float_d + difference_y_float_d
		SQRT sum_difference_d_xy players_distance_from_cp
 
		IF players_distance_from_cp < car3_distance_from_cp
			behind_car3 = 0
		ELSE
			behind_car3 = 1
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car3_d1 car3_stuck_x car3_stuck_y car3_stuck_z 4.0 4.0 4.0 0
		IF timerf_reset_flag = 0
			GET_GAME_TIMER timerf_started
			timerf_reset_flag = 1
		ENDIF
 
		IF timerf_reset_flag = 1
			GET_GAME_TIMER timerf_current
			timerf = timerf_current - timerf_started
			IF timerf > 8000
				IF NOT IS_CAR_ON_SCREEN car3_d1
					GET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
					GET_CLOSEST_CAR_NODE car3_x car3_y car3_z car3_x car3_y car3_z
					IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car3_x car3_y car3_z 4.0 4.0 4.0
						IF NOT IS_POINT_ON_SCREEN car3_x car3_y car3_z 4.0
							SET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
							TURN_CAR_TO_FACE_COORD car3_d1 car3_x_d1 car3_y_d1
							timerf_reset_flag = 0
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF NOT LOCATE_CAR_3D car3_d1 car3_stuck_x car3_stuck_y car3_stuck_z 4.0 4.0 4.0 0
		GET_CAR_COORDINATES car3_d1 car3_stuck_x car3_stuck_y car3_stuck_z
		timerf_reset_flag = 0
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN car3_d1
	AND IS_CAR_STOPPED car3_d1
		IF NOT IS_CAR_ON_SCREEN car3_d1
			GET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
			GET_CLOSEST_CAR_NODE car3_x car3_y car3_z car3_x car3_y car3_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car3_x car3_y car3_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car3_x car3_y car3_z 3.0
					SET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
					TURN_CAR_TO_FACE_COORD car3_d1 car3_x_d1 car3_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF timerc_reset_flag_d1 = 1
		IF NOT IS_CAR_STOPPED car3_d1
			timerc_reset_flag_d1 = 0
		ENDIF
	ENDIF
 
	IF IS_CAR_STOPPED car3_d1
		IF timerc_reset_flag_d1 = 0
			GET_GAME_TIMER timerc_started
			timerc_reset_flag_d1 = 1
		ENDIF
 
		IF timerc_reset_flag_d1 = 1
			GET_GAME_TIMER timerc_current
			timerc = timerc_current - timerc_started
			IF timerc > 5000
				IF NOT IS_CAR_ON_SCREEN car3_d1
					GET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
					GET_CLOSEST_CAR_NODE car3_x car3_y car3_z car3_x car3_y car3_z
					IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car3_x car3_y car3_z 4.0 4.0 4.0
						IF NOT IS_POINT_ON_SCREEN car3_x car3_y car3_z 4.0
							SET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
							TURN_CAR_TO_FACE_COORD car3_d1 car3_x_d1 car3_y_d1
							timerc_reset_flag_d1 = 0
						ENDIF
					ENDIF
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF LOCATE_CAR_3D car3_d1 car3_x_d1 car3_y_d1 car3_z_d1 ai_car3_locate_size ai_car3_locate_size ai_car3_locate_size 0
		++ car3_cpcounter
 
		IF car3_cpcounter = 1
			car3_x_d1 = cp3_x_d1
			car3_y_d1 = cp3_y_d1
			car3_z_d1 = cp3_z_d1
		ENDIF
 
		IF car3_cpcounter = 2
			car3_x_d1 = cp4_x_d1
			car3_y_d1 = cp4_y_d1
			car3_z_d1 = cp4_z_d1
		ENDIF
 
		IF car3_cpcounter = 3
			car3_x_d1 = cp5_x_d1
			car3_y_d1 = cp5_y_d1
			car3_z_d1 = cp5_z_d1
		ENDIF
 
		IF car3_cpcounter = 4
			car3_x_d1 = cp6_x_d1
			car3_y_d1 = cp6_y_d1
			car3_z_d1 = cp6_z_d1
		ENDIF
 
		IF car3_cpcounter = 5
			car3_x_d1 = cp7_x_d1
			car3_y_d1 = cp7_y_d1
			car3_z_d1 = cp7_z_d1
		ENDIF
 
		IF car3_cpcounter = 6
			car3_x_d1 = cp8_x_d1
			car3_y_d1 = cp8_y_d1
			car3_z_d1 = cp8_z_d1
		ENDIF
 
		IF car3_cpcounter = 7
			car3_x_d1 = cp9_x_d1
			car3_y_d1 = cp9_y_d1
			car3_z_d1 = cp9_z_d1
		ENDIF
 
		IF car3_cpcounter = 8
			car3_x_d1 = cp10_x_d1
			car3_y_d1 = cp10_y_d1
			car3_z_d1 = cp10_z_d1
		ENDIF
 
		IF car3_cpcounter = 9
			car3_x_d1 = cp11_x_d1
			car3_y_d1 = cp11_y_d1
			car3_z_d1 = cp11_z_d1
		ENDIF
 
		IF car3_cpcounter = 10
			car3_x_d1 = cp12_x_d1
			car3_y_d1 = cp12_y_d1
			car3_z_d1 = cp12_z_d1
		ENDIF
 
		IF car3_cpcounter = 11
			car3_x_d1 = cp13_x_d1
			car3_y_d1 = cp13_y_d1
			car3_z_d1 = cp13_z_d1
		ENDIF
 
		IF car3_cpcounter = 12
			car3_x_d1 = cp14_x_d1
			car3_y_d1 = cp14_y_d1
			car3_z_d1 = cp14_z_d1
		ENDIF
 
		IF car3_cpcounter = 13
			car3_x_d1 = cp15_x_d1
			car3_y_d1 = cp15_y_d1
			car3_z_d1 = cp15_z_d1
		ENDIF
 
		IF car3_cpcounter = 14
			car3_x_d1 = cp16_x_d1
			car3_y_d1 = cp16_y_d1
			car3_z_d1 = cp16_z_d1
		ENDIF
 
		IF car3_cpcounter = 15
			car3_x_d1 = cp17_x_d1
			car3_y_d1 = cp17_y_d1
			car3_z_d1 = cp17_z_d1
		ENDIF
 
		IF car3_cpcounter = 16
			car3_x_d1 = cp18_x_d1
			car3_y_d1 = cp18_y_d1
			car3_z_d1 = cp18_z_d1
		ENDIF
 
		IF car3_cpcounter = 17
			car3_x_d1 = cp2_x_d1
			car3_y_d1 = cp2_y_d1
			car3_z_d1 = cp2_z_d1
			ai_car3_locate_size = 6.0
		ENDIF
 
		IF car3_cpcounter = 18
//		AND	position > 0
			PRINT_NOW DIAB1_3 5000 1 //"~r~You failed to win the race!"
			GOTO mission_d1_failed		
		ENDIF
 
		IF ai_car3_locate_size = 7.0
			CAR_GOTO_COORDINATES car3_d1 car3_x_d1 car3_y_d1 car3_z_d1 
		ELSE
			CAR_GOTO_COORDINATES_ACCURATE car3_d1 car3_x_d1 car3_y_d1 car3_z_d1 
		ENDIF
 
	ENDIF
ELSE
 
	IF NOT IS_CAR_IN_WATER car3_d1
		behind_car3 = 0
		car3_cpcounter = 0
	ENDIF
 
	IF IS_CAR_IN_WATER car3_d1
		IF NOT IS_CAR_ON_SCREEN car3_d1
			GET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
			GET_CLOSEST_CAR_NODE car3_x car3_y car3_z car3_x car3_y car3_z
			IF NOT IS_POINT_OBSCURED_BY_A_MISSION_ENTITY car3_x car3_y car3_z 4.0 4.0 4.0
				IF NOT IS_POINT_ON_SCREEN car3_x car3_y car3_z 3.0
					SET_CAR_COORDINATES car3_d1 car3_x car3_y car3_z
					TURN_CAR_TO_FACE_COORD car3_d1 car3_x_d1 car3_y_d1
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
ENDIF
 
GOTO loop1
}	   		
 
// Mission d1 failed
 
mission_d1_failed:
PRINT_BIG M_FAIL 2000 1
RETURN
 
 
 
// mission d1 passed
 
mission_d1_passed:
 
GET_GAME_TIMER game_timer_end_d1
game_timer_end_d1 = game_timer_end_d1 - game_timer_start_d1
game_timer_end_d1 = game_timer_end_d1 / 1000
ADD_SCORE player 10000
PRINT_WITH_NUMBER_BIG M_PASS 10000 5000 1
PRINT_WITH_NUMBER_NOW DIAB1_2 game_timer_end_d1 5000 1 //"Race time: ~1~ seconds"
REGISTER_EL_BURRO_TIME game_timer_end_d1
CLEAR_WANTED_LEVEL player
PLAY_MISSION_PASSED_TUNE 1
//CLEAR_THREAT_FOR_PED_TYPE PEDTYPE_GANG_DIABLO THREAT_PLAYER1
 
IF flag_diablo1_passed_before = 0
	REGISTER_MISSION_PASSED	DIAB1
	PLAYER_MADE_PROGRESS 1
	flag_diablo_mission1_passed = 1
	START_NEW_SCRIPT diablo_mission2_loop
	flag_diablo1_passed_before = 1
ENDIF
 
RETURN
 
 
// mission cleanup
 
mission_cleanup_d1:
 
SWITCH_ROADS_ON 1034.0 -956.0 12.0 1063.0 -847.0 20.0
 
REMOVE_BLIP blip_car1_d1
REMOVE_BLIP blip_car2_d1
REMOVE_BLIP blip_car3_d1
REMOVE_BLIP blip_chase_d1
REMOVE_BLIP second_blip
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_DIABLO_A
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_DIABLO_B
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_CHEETAH
CLEAR_ONSCREEN_COUNTER game_timer_end_d1
 
flag_player_on_mission = 0
flag_player_on_diablo_mission = 0
MISSION_HAS_FINISHED
RETURN

diablo2

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Deablo mission 2**************************************
// ***********************************Destroy Icream Vans*************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff			
 
GOSUB mission_start_diablo2
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_diablo2_failed
ENDIF
 
GOSUB mission_cleanup_diablo2
 
MISSION_END
 
// Variables for mission
 
VAR_INT icecream_van1  flag_car_blip_displayed_dm2 // Vehicle for mission
 
VAR_INT blip1_icecream1 blip1_diablo2 blip2_diablo2	creamers_spotted_you
 
VAR_INT briefcase_diablo2 removed_ice_cream_blip// Counts up number of mission vans destroyed
 
VAR_INT ojective_creamed_guys_passed //ice_creamvan_stored_before
 
VAR_INT icecream_man1 icecreamvan_any creamed_guy1 creamed_guy2 creamed_guy3 creamed_guy4	
 
VAR_INT ojective_creamed_guy1_done_before ojective_creamed_guy2_done_before ojective_creamed_guy3_done_before ojective_creamed_guy4_done_before
 
VAR_FLOAT icecreamx icecreamy icecreamz 
 
VAR_INT creamed_guy1_health creamed_guy2_health creamed_guy3_health creamed_guy4_health
 
// ***************************************Mission Start*************************************
 
mission_start_diablo2:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_diablo_mission = 1
SCRIPT_NAME diablo2
WAIT 0
 
SET_PED_DENSITY_MULTIPLIER 0.0
CLEAR_AREA_OF_CHARS 890.3 -309.1 0.0 1038.1 -132.9 10.0
 
LOAD_CUTSCENE EL_PH2
SET_CUTSCENE_OFFSET 938.27 -229.561 4.023
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
 
DO_FADE 1500 FADE_IN
 
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
 
GET_CUTSCENE_TIME cs_time
 
WHILE cs_time < 2000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
PRINT_NOW ( DIAB2_A ) 10000 1 
 
WHILE cs_time < 9115
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_B ) 10000 1 
 
WHILE cs_time < 15149
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_C ) 10000 1 
 
WHILE cs_time < 18028
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_D ) 10000 1 
 
WHILE cs_time < 20605
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_E ) 10000 1 
 
WHILE cs_time < 22985
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_F ) 10000 1 
 
WHILE cs_time < 26130
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_G ) 10000 1 
 
WHILE cs_time < 30784
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB2_H ) 10000 1 
 
WHILE cs_time < 33726
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 34000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
 
DO_FADE 1500 FADE_OUT
 
WHILE NOT HAS_CUTSCENE_FINISHED
	WAIT 0
 
ENDWHILE
 
CLEAR_PRINTS
 
WHILE GET_FADING_STATUS
	WAIT 0
ENDWHILE
 
CLEAR_CUTSCENE
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
 
SET_PED_DENSITY_MULTIPLIER 1.0
 
ojective_creamed_guy1_done_before = 0
ojective_creamed_guy2_done_before = 0
ojective_creamed_guy3_done_before = 0
ojective_creamed_guy4_done_before = 0
ojective_creamed_guys_passed = 0
creamers_spotted_you = 0
removed_ice_cream_blip = 0
 
REQUEST_MODEL CAR_MRWHOOPEE
REQUEST_MODEL PED_GANG_MAFIA_A
REQUEST_MODEL PED_LI_MAN1
 
 
	WHILE NOT HAS_MODEL_LOADED CAR_MRWHOOPEE
	OR NOT HAS_MODEL_LOADED PED_GANG_MAFIA_A
	OR NOT HAS_MODEL_LOADED PED_LI_MAN1
		WAIT 0
	ENDWHILE
 
WAIT 2000
 
CREATE_PICKUP briefcase PICKUP_ONCE	934.9 -69.8 8.1 briefcase_diablo2
ADD_BLIP_FOR_PICKUP	briefcase_diablo2 blip1_diablo2
 
PRINT ( DIAB2_1 ) 5000 1 // Pick up briefcase
 
WHILE NOT HAS_PICKUP_BEEN_COLLECTED briefcase_diablo2 
	WAIT 0
 
ENDWHILE
 
REMOVE_BLIP blip1_diablo2
 
 
CREATE_CAR CAR_MRWHOOPEE 1381.0 -382.0 -100.0 icecream_van1  
CREATE_CHAR_INSIDE_CAR icecream_van1 PEDTYPE_CIVMALE PED_LI_MAN1 icecream_man1
SET_CAR_DRIVING_STYLE icecream_van1 DRIVINGMODE_STOPFORCARS
ADD_BLIP_FOR_CAR icecream_van1 blip1_icecream1
 
PRINT_NOW ( DIAB2_2 ) 5000 1 // Find an icecream van
 
 
WHILE NOT IS_PLAYER_IN_MODEL Player CAR_MRWHOOPEE
	WAIT 0
 
	IF IS_CAR_DEAD icecream_van1 
		GOTO mission_diablo2_failed	
	ENDIF
 
ENDWHILE
 
REMOVE_BLIP blip1_icecream1
STORE_CAR_PLAYER_IS_IN player icecreamvan_any
 
	IF NOT IS_CAR_DEAD icecreamvan_any 
		ARM_CAR_WITH_BOMB icecreamvan_any CARBOMB_REMOTE
		GIVE_PLAYER_DETONATOR
		SET_CURRENT_PLAYER_WEAPON Player WEAPONTYPE_DETONATOR
	ENDIF
 
 PRINT_NOW ( DIAB2_3 ) 5000 1 // Park the icecream van down at atlantic quays
 
flag_car_blip_displayed_dm2 = TRUE
blob_flag = 1
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D icecreamvan_any 1215.9 -1128.7 11.2 1210.4 -1123.3 14.2 blob_flag
OR NOT IS_PLAYER_IN_CAR player icecreamvan_any
OR NOT IS_ICECREAM_JINGLE_ON icecreamvan_any
 
	WAIT 0
 
		IF IS_CAR_DEAD icecreamvan_any 
			GOTO mission_diablo2_failed	
		ENDIF
 
		IF IS_CAR_STOPPED_IN_AREA_3D icecreamvan_any 1215.9 -1128.7 11.2 1210.4 -1123.3 14.2 FALSE
		AND IS_PLAYER_IN_CAR player icecreamvan_any
			GET_CONTROLLER_MODE controlmode
			IF controlmode = 0
				PRINT_NOW ( DIAB2_6 ) 1000 1 // Tap L3 quickly to set the Icecream jingle
			ENDIF
			IF controlmode = 1
				PRINT_NOW ( DIAB2_4 ) 1000 1 // Tap L1 quickly to set the Icecream jingle
			ENDIF
			IF controlmode = 2
				PRINT_NOW ( DIAB2_7 ) 1000 1 // Tap R1 quickly to set the Icecream jingle
			ENDIF
			IF controlmode = 3
				PRINT_NOW ( DIAB2_6 ) 1000 1 // Tap L3 quickly to set the Icecream jingle
			ENDIF
		ENDIF
 
		IF IS_PLAYER_IN_CAR player icecreamvan_any
			IF flag_car_blip_displayed_dm2 = TRUE
				ADD_BLIP_FOR_COORD 1219.7 -1137.2 -100.0 blip2_diablo2
				blob_flag = 1
				REMOVE_BLIP blip1_icecream1
				flag_car_blip_displayed_dm2 = FALSE
			ENDIF
		ENDIF
 
		IF NOT IS_PLAYER_IN_CAR player icecreamvan_any
			IF flag_car_blip_displayed_dm2 = FALSE
				ADD_BLIP_FOR_CAR icecreamvan_any blip1_icecream1
				blob_flag = 0
				REMOVE_BLIP blip2_diablo2
				PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
				flag_car_blip_displayed_dm2 = TRUE
			ENDIF
		ENDIF
 
ENDWHILE	
 
CLEAR_AREA 1190.5 -1141.2 11.6 2.0 TRUE		
CREATE_CHAR PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_A 1190.5 -1141.2 11.6 creamed_guy1
 
CLEAR_AREA 1192.5 -1141.2 11.6 2.0 TRUE		
CREATE_CHAR PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_A 1192.5 -1141.2 11.6 creamed_guy2
 
CLEAR_AREA 1194.5 -1141.2 11.6 2.0 TRUE		
CREATE_CHAR PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_A 1194.5 -1141.2 11.6 creamed_guy3
 
CLEAR_AREA 1196.5 -1141.2 11.6 2.0 TRUE		
CREATE_CHAR PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_A 1196.5 -1141.2 11.6 creamed_guy4
 
GIVE_WEAPON_TO_CHAR creamed_guy1 WEAPONTYPE_UZI 160
GIVE_WEAPON_TO_CHAR creamed_guy2 WEAPONTYPE_UZI 160
GIVE_WEAPON_TO_CHAR creamed_guy3 WEAPONTYPE_UZI 160
GIVE_WEAPON_TO_CHAR creamed_guy4 WEAPONTYPE_UZI 160
SET_CHAR_PERSONALITY creamed_guy1 PEDSTAT_TOUGH_GUY
SET_CHAR_PERSONALITY creamed_guy2 PEDSTAT_TOUGH_GUY								   								   								   								   
SET_CHAR_PERSONALITY creamed_guy3 PEDSTAT_TOUGH_GUY								   								   								   								   
SET_CHAR_PERSONALITY creamed_guy4 PEDSTAT_TOUGH_GUY								   								   								   								   								   								   								   								   
 
PRINT_NOW ( DIAB2_5 ) 5000 1 // Use the remote to detonate the icecream van
 
WAIT 2000
 
CLEAR_AREA 1205.6 -1141.1 11.6 10.0 TRUE		
 
IF NOT IS_CHAR_DEAD	creamed_guy1
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy1 1205.6 -1141.1
ENDIF
 
IF NOT IS_CHAR_DEAD	creamed_guy2
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy2 1205.6 -1141.1
ENDIF
 
IF NOT IS_CHAR_DEAD	creamed_guy3
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy3 1205.6 -1141.1
ENDIF
 
IF NOT IS_CHAR_DEAD	creamed_guy4
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy4 1205.6 -1141.1
ENDIF
 
 
WHILE NOT ojective_creamed_guys_passed = 4
	WAIT 0
 
	IF IS_CAR_DEAD icecreamvan_any
	AND removed_ice_cream_blip = 0 
		REMOVE_BLIP blip1_icecream1
		removed_ice_cream_blip = 1		
	ENDIF
 
	IF IS_CHAR_DEAD creamed_guy1
	AND IS_CHAR_DEAD creamed_guy2
	AND IS_CHAR_DEAD creamed_guy3
	AND IS_CHAR_DEAD creamed_guy4
		GOTO mission_diablo2_passed
	ENDIF	
 
	IF IS_CHAR_DEAD creamed_guy1
	AND ojective_creamed_guy1_done_before = 0
		ojective_creamed_guys_passed ++
		ojective_creamed_guy1_done_before = 1
	ENDIF
 
	IF IS_CHAR_DEAD creamed_guy2
	AND ojective_creamed_guy2_done_before = 0
		ojective_creamed_guys_passed ++
		ojective_creamed_guy2_done_before = 1
	ENDIF
 
	IF IS_CHAR_DEAD creamed_guy3
	AND ojective_creamed_guy3_done_before = 0
		ojective_creamed_guys_passed ++
		ojective_creamed_guy3_done_before = 1
	ENDIF
 
	IF IS_CHAR_DEAD creamed_guy4
	AND ojective_creamed_guy4_done_before = 0
		ojective_creamed_guys_passed ++
		ojective_creamed_guy4_done_before = 1
	ENDIF
 
	GET_CAR_COORDINATES icecreamvan_any icecreamx icecreamy icecreamz
 
	IF IS_CHAR_OBJECTIVE_PASSED creamed_guy1
	AND ojective_creamed_guy1_done_before = 0
		SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy1 icecreamx icecreamy
		ojective_creamed_guys_passed ++
		ojective_creamed_guy1_done_before = 1
	ENDIF
 
	IF IS_CHAR_OBJECTIVE_PASSED creamed_guy2
	AND ojective_creamed_guy2_done_before = 0
		SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy2 icecreamx icecreamy
		ojective_creamed_guys_passed ++
		ojective_creamed_guy2_done_before = 1
	ENDIF
 
	IF IS_CHAR_OBJECTIVE_PASSED creamed_guy3
	AND ojective_creamed_guy3_done_before = 0
		SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy3 icecreamx icecreamy
		ojective_creamed_guys_passed ++
		ojective_creamed_guy3_done_before = 1
	ENDIF
 
	IF IS_CHAR_OBJECTIVE_PASSED creamed_guy4
	AND ojective_creamed_guy4_done_before = 0
		SET_CHAR_OBJ_GOTO_COORD_ON_FOOT creamed_guy4 icecreamx icecreamy
		ojective_creamed_guys_passed ++
		ojective_creamed_guy4_done_before = 1
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy1
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy1 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy1 Player
			SET_CHAR_THREAT_SEARCH creamed_guy1 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy2
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy2 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy2 Player
			SET_CHAR_THREAT_SEARCH creamed_guy2 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy3
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy3 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy3 Player
			SET_CHAR_THREAT_SEARCH creamed_guy3 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy4
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy4 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy4 Player 
			SET_CHAR_THREAT_SEARCH creamed_guy4 THREAT_PLAYER1
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy1
		GET_CHAR_HEALTH creamed_guy1 creamed_guy1_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy2
		GET_CHAR_HEALTH creamed_guy2 creamed_guy2_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy3
		GET_CHAR_HEALTH creamed_guy3 creamed_guy3_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy4
		GET_CHAR_HEALTH creamed_guy4 creamed_guy4_health
	ENDIF
 
	IF creamed_guy1_health < 100
	OR creamed_guy2_health < 100
	OR creamed_guy3_health < 100
	OR creamed_guy4_health < 100
 
		IF creamers_spotted_you = 0
 
			IF NOT IS_CHAR_DEAD creamed_guy1
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy1 Player
				SET_CHAR_THREAT_SEARCH creamed_guy1 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy2
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy2 Player
				SET_CHAR_THREAT_SEARCH creamed_guy2 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy3
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy3 Player
				SET_CHAR_THREAT_SEARCH creamed_guy3 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy4
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy4 Player
				SET_CHAR_THREAT_SEARCH creamed_guy4 THREAT_PLAYER1
			ENDIF
 
			creamers_spotted_you = 1
		ENDIF
 
	ENDIF
 
ENDWHILE
 
 
WHILE NOT IS_CHAR_DEAD creamed_guy1
OR NOT IS_CHAR_DEAD creamed_guy2
OR NOT IS_CHAR_DEAD creamed_guy3
OR NOT IS_CHAR_DEAD creamed_guy4
	WAIT 0
 
	IF IS_CAR_DEAD icecreamvan_any
	AND removed_ice_cream_blip = 0 
		REMOVE_BLIP blip1_icecream1
		removed_ice_cream_blip = 1		
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy1
		GET_CHAR_HEALTH creamed_guy1 creamed_guy1_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy2
		GET_CHAR_HEALTH creamed_guy2 creamed_guy2_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy3
		GET_CHAR_HEALTH creamed_guy3 creamed_guy3_health
	ENDIF
	IF NOT IS_CHAR_DEAD	creamed_guy4
		GET_CHAR_HEALTH creamed_guy4 creamed_guy4_health
	ENDIF
 
	IF creamed_guy1_health < 100
	OR creamed_guy2_health < 100
	OR creamed_guy3_health < 100
	OR creamed_guy4_health < 100
 
		IF creamers_spotted_you = 0
 
			IF NOT IS_CHAR_DEAD creamed_guy1
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy1 Player
				SET_CHAR_THREAT_SEARCH creamed_guy1 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy2
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy2 Player
				SET_CHAR_THREAT_SEARCH creamed_guy2 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy3
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy3 Player
				SET_CHAR_THREAT_SEARCH creamed_guy3 THREAT_PLAYER1
			ENDIF
 
			IF NOT IS_CHAR_DEAD creamed_guy4
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy4 Player
				SET_CHAR_THREAT_SEARCH creamed_guy4 THREAT_PLAYER1
			ENDIF
 
			creamers_spotted_you = 1
		ENDIF
 
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy1
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy1 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy1 Player
			SET_CHAR_THREAT_SEARCH creamed_guy1 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy2
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy2 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy2 Player
			SET_CHAR_THREAT_SEARCH creamed_guy2 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy3
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy3 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy3 Player
			SET_CHAR_THREAT_SEARCH creamed_guy3 THREAT_PLAYER1 
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD creamed_guy4
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player creamed_guy4 8.0 8.0 2.0 FALSE
			SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT creamed_guy4 Player 
			SET_CHAR_THREAT_SEARCH creamed_guy4 THREAT_PLAYER1
		ENDIF
	ENDIF
 
ENDWHILE
 
GOTO mission_diablo2_passed
}
 
 // Mission Diablo2 failed
 
mission_diablo2_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission Diablo2 passed
 
mission_diablo2_passed:
 
flag_diablo_mission2_passed = 1
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) 6000 5000 1 //"Mission Passed!"
CLEAR_WANTED_LEVEL player
ADD_SCORE player 8000
REGISTER_MISSION_PASSED	DIAB2
PLAYER_MADE_PROGRESS 1
START_NEW_SCRIPT diablo_mission3_loop
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_diablo2:
 
flag_player_on_mission = 0
flag_player_on_diablo_mission = 0
REMOVE_BLIP blip1_icecream1
REMOVE_BLIP blip1_diablo2
REMOVE_BLIP blip2_diablo2
REMOVE_PICKUP briefcase_diablo2
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_MRWHOOPEE
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_MAFIA_A
MARK_MODEL_AS_NO_LONGER_NEEDED PED_LI_MAN1
SET_PLAYER_AMMO Player WEAPONTYPE_DETONATOR 0
MISSION_HAS_FINISHED
RETURN

diablo3

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Deablo mission 3**************************************
// ***********************************BURN, BURN THEM ALL!!!!*********************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff			
 
GOSUB mission_start_diablo3
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_diablo3_failed
ENDIF
 
GOSUB mission_cleanup_diablo3
 
MISSION_END
 
// Variables for mission
 
//VAR_INT countdown_diablo3 // On screen countdown timer
 
//VAR_INT counter1_dm3
 
VAR_INT counter_diablo3 // Counts up number of mission triads killed
 
VAR_INT burn_man1 burn_man2 burn_man3 burn_man4 burn_man5 burn_man6 
 
VAR_INT dead_burn_man1 dead_burn_man2 dead_burn_man3 dead_burn_man4 dead_burn_man5 dead_burn_man6
 
VAR_INT blip1_diablo3 flamethrower_diablo3
 
VAR_INT all_gang_created_before	traid_threat_cleared_D3
 
VAR_INT CurrentStatus given_money_before
 
// ***************************************Mission Start*************************************
 
mission_start_diablo3:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_diablo_mission = 1
SCRIPT_NAME diablo3
WAIT 0
 
 
REQUEST_MODEL PED_GANG_TRIAD_A
REQUEST_MODEL PED_GANG_TRIAD_B
 
traid_threat_cleared_D3 = 0
 
SET_PED_DENSITY_MULTIPLIER 0.0
CLEAR_AREA_OF_CHARS 890.3 -309.1 0.0 1038.1 -132.9 10.0
 
 
LOAD_CUTSCENE EL_PH4
SET_CUTSCENE_OFFSET 938.27 -229.561 4.023
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
 
DO_FADE 1500 FADE_IN
 
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
 
GET_CUTSCENE_TIME cs_time
 
WHILE cs_time < 2000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
PRINT_NOW ( DIAB3_A ) 10000 1 
 
WHILE cs_time < 5553
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_B ) 10000 1 
 
WHILE cs_time < 7767
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_C ) 10000 1 
 
WHILE cs_time < 11105
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_D ) 10000 1 
 
WHILE cs_time < 14603
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_E ) 10000 1 
 
WHILE cs_time < 17813
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_F ) 10000 1 
 
WHILE cs_time < 22948
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB3_G ) 10000 1 
 
WHILE cs_time < 23775
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 26333
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
 
 
DO_FADE 1500 FADE_OUT
 
WHILE NOT HAS_CUTSCENE_FINISHED
	WAIT 0
 
ENDWHILE
 
CLEAR_PRINTS
 
WHILE GET_FADING_STATUS
	WAIT 0
ENDWHILE
 
CLEAR_CUTSCENE
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
SET_PED_DENSITY_MULTIPLIER 1.0
 
SETUP_ZONE_PED_INFO CHINA DAY (30) 0 650 0 (0 0 0 0) 0  
SETUP_ZONE_PED_INFO CHINA NIGHT (30) 0 650 0 (0 0 0 0) 0      
 
 
// START MISSION
 
all_gang_created_before = 0
counter_diablo3 = 0
dead_burn_man1 = 0
dead_burn_man2 = 0
dead_burn_man3 = 0
dead_burn_man4 = 0
dead_burn_man5 = 0
dead_burn_man6 = 0
given_money_before = 0
 
 
IF IS_THREAT_FOR_PED_TYPE PEDTYPE_GANG_TRIAD THREAT_PLAYER1
	CLEAR_THREAT_FOR_PED_TYPE PEDTYPE_GANG_TRIAD THREAT_PLAYER1
	traid_threat_cleared_D3 = 1
ENDIF
 
RESET_NUM_OF_MODELS_KILLED_BY_PLAYER
 
CREATE_PICKUP_WITH_AMMO WEAPON_FLAME PICKUP_ONCE 0 879.2 -810.0 -100.0 flamethrower_diablo3     
ADD_SPRITE_BLIP_FOR_COORD 879.2 -810.0 -100.0 RADAR_SPRITE_WEAPON blip1_diablo3
//CHANGE_BLIP_DISPLAY blip1_diablo3 BLIP_ONLY
 
WHILE NOT HAS_MODEL_LOADED PED_GANG_TRIAD_A
OR NOT HAS_MODEL_LOADED	PED_GANG_TRIAD_B
	WAIT 0
 
ENDWHILE
 
WHILE NOT HAS_PICKUP_BEEN_COLLECTED flamethrower_diablo3 
	WAIT 0
 
ENDWHILE
 
REMOVE_BLIP blip1_diablo3
 
START_KILL_FRENZY (DIAB3_1) WEAPONTYPE_FLAMETHROWER 151000 25 PED_GANG_TRIAD_A PED_GANG_TRIAD_B -1 -1 FALSE
 
Diablo3_loop:
 
WAIT 0
 
READ_KILL_FRENZY_STATUS CurrentStatus
 
	IF CurrentStatus = 2
		GOTO mission_diablo3_passed
	ENDIF
 
	IF CurrentStatus = 3
		GOTO mission_diablo3_failed
	ENDIF
 
	IF IS_PLAYER_IN_AREA_2D player 1038.0 -781.0 838.0 -915.0 FALSE
 
		IF all_gang_created_before = 0
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 932.0 -846.0 14.5 burn_man1
			GIVE_WEAPON_TO_CHAR burn_man1 WEAPONTYPE_PISTOL 60
 
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_B 933.0 -846.0 14.5 burn_man2
			GIVE_WEAPON_TO_CHAR burn_man2 WEAPONTYPE_PISTOL 60
			SET_CHAR_AS_LEADER burn_man2 burn_man1
 
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 934.0 -846.0 14.5 burn_man3
			GIVE_WEAPON_TO_CHAR burn_man3 WEAPONTYPE_PISTOL 60
			SET_CHAR_AS_LEADER burn_man3 burn_man1
 
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_B 935.0 -846.0 14.5 burn_man4
			GIVE_WEAPON_TO_CHAR burn_man4 WEAPONTYPE_PISTOL 60
			SET_CHAR_AS_LEADER burn_man4 burn_man1
 
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 936.0 -846.0 14.5 burn_man5
			GIVE_WEAPON_TO_CHAR burn_man5 WEAPONTYPE_PISTOL 60
			SET_CHAR_AS_LEADER burn_man5 burn_man1
 
			CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_B 937.0 -846.0 14.5 burn_man6
			GIVE_WEAPON_TO_CHAR burn_man6 WEAPONTYPE_PISTOL 60
			SET_CHAR_AS_LEADER burn_man6 burn_man1
 
			all_gang_created_before = 1
		ENDIF
 
 
		IF IS_CHAR_DEAD burn_man1 
		AND dead_burn_man1 = 0
			++ counter_diablo3
			dead_burn_man1 = 1	
		ENDIF
 
		IF IS_CHAR_DEAD burn_man2 
		AND dead_burn_man2 = 0
			++ counter_diablo3
			dead_burn_man2 = 1	
		ENDIF
 
		IF IS_CHAR_DEAD burn_man3 
		AND dead_burn_man3 = 0
			++ counter_diablo3
			dead_burn_man3 = 1	
		ENDIF
 
		IF IS_CHAR_DEAD burn_man4 
		AND dead_burn_man4 = 0
			++ counter_diablo3
			dead_burn_man4 = 1	
		ENDIF
 
		IF IS_CHAR_DEAD burn_man5 
		AND dead_burn_man5 = 0
			++ counter_diablo3
			dead_burn_man5 = 1	
		ENDIF
 
		IF IS_CHAR_DEAD burn_man6 
		AND dead_burn_man6 = 0
			++ counter_diablo3
			dead_burn_man6 = 1	
		ENDIF
 
		IF counter_diablo3 = 6
		AND given_money_before = 0
			ADD_SCORE player 6000
			GET_PLAYER_COORDINATES Player player_X player_Y player_Z
			ADD_ONE_OFF_SOUND player_X player_Y player_Z SOUND_PART_MISSION_COMPLETE
			given_money_before = 1
		ENDIF
 
		IF IS_PLAYER_SHOOTING_IN_AREA Player 916.0 -863.0 956.0 -830.0 FALSE
		OR IS_PLAYER_IN_AREA_2D player 916.0 -863.0 956.0 -830.0 FALSE
 
			IF dead_burn_man1 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man1 Player
			ENDIF
			IF dead_burn_man2 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man2 Player
			ENDIF
			IF dead_burn_man3 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man3 Player
			ENDIF
			IF dead_burn_man4 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man4 Player
			ENDIF
			IF dead_burn_man5 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man5 Player
			ENDIF
			IF dead_burn_man6 = 0
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT burn_man6 Player
			ENDIF			
		ENDIF
 
	ENDIF
 
READ_KILL_FRENZY_STATUS CurrentStatus
 
GOTO Diablo3_loop
 
 
}
 // Mission toni1 failed
 
mission_diablo3_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission toni1 passed
 
mission_diablo3_passed:
 
flag_diablo_mission3_passed = 1
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) 10000 5000 1 //"Mission Passed!"
CLEAR_WANTED_LEVEL player
ADD_SCORE player 10000
REGISTER_MISSION_PASSED	DIAB3
PLAYER_MADE_PROGRESS 1
SET_THREAT_FOR_PED_TYPE PEDTYPE_GANG_TRIAD THREAT_PLAYER1
START_NEW_SCRIPT diablo_mission4_loop
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_diablo3:
 
flag_player_on_mission = 0
flag_player_on_diablo_mission = 0
REMOVE_BLIP blip1_diablo3
REMOVE_PICKUP flamethrower_diablo3
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_TRIAD_A
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_TRIAD_B
    SETUP_ZONE_PED_INFO CHINA DAY   (20) 0 200 0 (0 0 0 0) 20 //China town 
    SETUP_ZONE_PED_INFO CHINA NIGHT (10) 0 300 0 (0 0 0 0) 10
IF traid_threat_cleared_D3 = 1
	SET_THREAT_FOR_PED_TYPE PEDTYPE_GANG_TRIAD THREAT_PLAYER1
ENDIF
MISSION_HAS_FINISHED
RETURN

diablo4

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Deablo mission 4**************************************
// ***************************************Donkey Porn*****************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff			
 
GOSUB mission_start_diablo4
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_diablo4_failed
ENDIF
 
GOSUB mission_cleanup_diablo4
 
MISSION_END
 
// Variables for mission
 
VAR_INT counter_diablo4 // Counts up number of mission vans destroyed
 
VAR_INT porn_man porn_van blip1_porn_van blip2_porn_shop blip3_pornman
 
VAR_INT NumEaten_diablo4 NumEaten_diablo4_total eaten_all_the_porn
 
VAR_INT diablo_collect_porn_van	audio_loop_diablo4
 
VAR_INT flag_car_blip_displayed_dm4	found_perv_before
 
VAR_INT donkeymag1, donkeymag2, donkeymag3, pervert1, pervert2, pervert3, pervert4, pervert5, pervert6, pervert7, pervert8
 
//VAR_INT pac_man_record_on	//Create a new race
 
 
// ***************************************Mission Start*************************************
 
mission_start_diablo4:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_diablo_mission = 1
SCRIPT_NAME diablo4
 
audio_loop_diablo4 = 0
NumEaten_diablo4_total = 0 
found_perv_before = 0
eaten_all_the_porn = 0
 
WAIT 0
 
SET_PED_DENSITY_MULTIPLIER 0.0
CLEAR_AREA_OF_CHARS 890.3 -309.1 0.0 1038.1 -132.9 10.0
 
LOAD_CUTSCENE EL_PH3
SET_CUTSCENE_OFFSET 938.27 -229.561 4.023
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
DO_FADE 1500 FADE_IN
 
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
 
GET_CUTSCENE_TIME cs_time
 
WHILE cs_time < 2000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_A ) 10000 1 
 
WHILE cs_time < 7326
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_B ) 10000 1 
 
WHILE cs_time < 10740
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_C ) 10000 1 
 
WHILE cs_time < 12550
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_D ) 10000 1 
 
WHILE cs_time < 17195
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_E ) 10000 1 
 
WHILE cs_time < 22417
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_F ) 10000 1 
 
WHILE cs_time < 24124
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_G ) 10000 1 
 
WHILE cs_time < 28426
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( DIAB4_H ) 10000 1 
 
WHILE cs_time < 33574
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 34000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
 
DO_FADE 1500 FADE_OUT
 
WHILE NOT HAS_CUTSCENE_FINISHED
	WAIT 0
 
ENDWHILE
 
CLEAR_PRINTS
 
WHILE GET_FADING_STATUS
	WAIT 0
ENDWHILE
 
CLEAR_CUTSCENE
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
SET_PED_DENSITY_MULTIPLIER 1.0
 
 
LOAD_MISSION_AUDIO EL3_A
 
WHILE NOT HAS_MISSION_AUDIO_LOADED
	WAIT 0
 
ENDWHILE
 
 
NumEaten_diablo4 = 0
 
	IF flag_asuka_mission1_passed = 1
		SET_GANG_WEAPONS GANG_MAFIA WEAPONTYPE_PISTOL WEAPONTYPE_UZI //The Mafia
	ENDIF
 
	REQUEST_MODEL CAR_RUMPO
	REQUEST_MODEL PED_MALE2
    LOAD_SPECIAL_CHARACTER 1 DONKY
 
	WHILE NOT HAS_MODEL_LOADED CAR_RUMPO
	OR NOT HAS_MODEL_LOADED PED_MALE2
		WAIT 0
	ENDWHILE
 
	CLEAR_AREA 918.2 -269.7 5.0 5.0	TRUE
	CREATE_CAR CAR_RUMPO 918.2 -269.7 -100.0 diablo_collect_porn_van  
	ADD_BLIP_FOR_CAR diablo_collect_porn_van blip1_porn_van
 
	IF IS_CAR_DEAD diablo_collect_porn_van
		GOTO mission_diablo4_failed	
	ENDIF
 
//GOTO pervert_test //TEST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
WHILE NOT IS_PLAYER_IN_CAR player diablo_collect_porn_van
	WAIT 0
 
	IF IS_CAR_DEAD diablo_collect_porn_van
		GOTO mission_diablo4_failed	
	ENDIF
 
ENDWHILE
 
START_PACMAN_RACE 0
 
SET_POLICE_IGNORE_PLAYER Player ON
SET_PLAYER_CONTROL Player OFF
SWITCH_WIDESCREEN ON
 
 
IF LOCATE_CAR_2D diablo_collect_porn_van 918.2 -269.7 10.0 10.0 FALSE
	SET_FIXED_CAMERA_POSITION 914.282 -157.729 6.409 0.0 0.0 0.0 
	POINT_CAMERA_AT_POINT 914.107 -156.829 6.012 INTERPOLATION
ELSE
	SET_FIXED_CAMERA_POSITION 914.282 -157.729 6.409 0.0 0.0 0.0 
	POINT_CAMERA_AT_POINT 914.107 -156.829 6.012 JUMP_CUT
ENDIF
 
WAIT 4000
 
SET_POLICE_IGNORE_PLAYER Player OFF
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA_JUMPCUT
 
	REMOVE_BLIP blip1_porn_van
 
	CREATE_CAR CAR_RUMPO 1577.1 -679.0 -100.0 porn_van
	SET_CAR_HEADING porn_van 309.0
 
	CREATE_CHAR PEDTYPE_GANG_COLOMBIAN PED_MALE2 1574.0 -681.1 -100.0 porn_man
	ADD_BLIP_FOR_CHAR porn_man blip3_pornman
	CHANGE_BLIP_DISPLAY blip3_pornman MARKER_ONLY
 
	counter_diablo4 = 26000
	DISPLAY_ONSCREEN_TIMER counter_diablo4
 
 
	IF IS_CAR_DEAD diablo_collect_porn_van
		GOTO mission_diablo4_failed	
	ENDIF
 
	flag_car_blip_displayed_dm4 = TRUE
 
 
WHILE NOT IS_CHAR_DEAD porn_man 
	WAIT 0	
 
	IF IS_CAR_DEAD diablo_collect_porn_van
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_diablo4_failed	
	ENDIF
 
	IF NOT IS_CHAR_DEAD	porn_man
		IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player porn_man 30.0 30.0 FALSE
		AND found_perv_before = 0
			CLEAR_ONSCREEN_TIMER counter_diablo4
			found_perv_before = 1
		ENDIF
	ENDIF
 
	IF counter_diablo4 = 0
		GOTO mission_diablo4_failed
	ENDIF
 
	GET_NUMBER_OF_POWER_PILLS_EATEN NumEaten_diablo4
 
	IF NumEaten_diablo4 > 0
	AND IS_PLAYER_IN_CAR player diablo_collect_porn_van
		counter_diablo4 = counter_diablo4 + 1300
		CLEAR_NUMBER_OF_POWER_PILLS_EATEN
		NumEaten_diablo4_total ++
	ENDIF
 
	IF NumEaten_diablo4_total > 0
	AND audio_loop_diablo4 = 0 
		PLAY_MISSION_AUDIO
		audio_loop_diablo4 = 1
	ENDIF
 
	IF IS_PLAYER_IN_CAR player diablo_collect_porn_van
		IF flag_car_blip_displayed_dm4 = TRUE
			REMOVE_BLIP blip1_porn_van
			CLEAR_THIS_PRINT  ( IN_VEH )
			flag_car_blip_displayed_dm4 = FALSE
		ENDIF
	ENDIF
 
	IF NOT IS_PLAYER_IN_CAR player diablo_collect_porn_van
		IF flag_car_blip_displayed_dm4 = FALSE
			ADD_BLIP_FOR_CAR diablo_collect_porn_van blip1_porn_van
			PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
			flag_car_blip_displayed_dm4 = TRUE
		ENDIF
	ENDIF
 
	IF NumEaten_diablo4_total = 106
	AND eaten_all_the_porn = 0
		ADD_SCORE player 10000
		GET_PLAYER_COORDINATES Player player_X player_Y player_Z
		ADD_ONE_OFF_SOUND player_X player_Y player_Z SOUND_PART_MISSION_COMPLETE
		eaten_all_the_porn = 1			
	ENDIF
 
ENDWHILE
 
	REMOVE_BLIP blip3_pornman
	REMOVE_BLIP blip1_porn_van
	ADD_BLIP_FOR_COORD 973.9 -428.3 -100.0 blip2_porn_shop
	REMOVE_BLIP blip2_porn_shop
 
	CLEAR_ONSCREEN_TIMER counter_diablo4
	CLEAR_PACMAN
 
	PRINT_NOW ( DIAB4_1 ) 5000 1 // Mission brief
 
	IF IS_CAR_DEAD diablo_collect_porn_van 
		GOTO mission_diablo4_failed	
	ENDIF
 
	IF IS_PLAYER_IN_CAR	player diablo_collect_porn_van
		flag_car_blip_displayed_dm4 = TRUE
	ELSE
	    flag_car_blip_displayed_dm4 = FALSE
	ENDIF
 
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D diablo_collect_porn_van 976.5 -422.8 14.5 970.8 -433.4 16.9 TRUE
	WAIT 0
 
		IF IS_CAR_DEAD diablo_collect_porn_van
			PRINT_NOW ( WRECKED ) 5000 1 
			GOTO mission_diablo4_failed
		ENDIF
 
		IF IS_PLAYER_IN_CAR player diablo_collect_porn_van
			IF flag_car_blip_displayed_dm4 = TRUE
				ADD_BLIP_FOR_COORD 973.9 -428.3 -100.0 blip2_porn_shop
				REMOVE_BLIP blip1_porn_van
				CLEAR_THIS_PRINT  ( IN_VEH ) 
			flag_car_blip_displayed_dm4 = FALSE
			ENDIF
		ENDIF
 
		IF NOT IS_PLAYER_IN_CAR player diablo_collect_porn_van
			IF flag_car_blip_displayed_dm4 = FALSE
				ADD_BLIP_FOR_CAR diablo_collect_porn_van blip1_porn_van
				REMOVE_BLIP blip2_porn_shop
				PRINT_SOON ( IN_VEH ) 5000 1 //"Get back in the car!"
				flag_car_blip_displayed_dm4 = TRUE
			ENDIF
		ENDIF
 
ENDWHILE
 
//PERVERTS CUT SCENE*********************************************************************
 
//pervert_test:
 
	SET_POLICE_IGNORE_PLAYER Player On
	SET_PLAYER_CONTROL Player Off
	SWITCH_WIDESCREEN ON
	SET_PED_DENSITY_MULTIPLIER 0.0
 
	WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1  
		WAIT 0
 
	ENDWHILE
 
WAIT 1000
 
SET_MUSIC_DOES_FADE FALSE
SET_FADING_COLOUR 0 0 0
DO_FADE 1000 FADE_OUT
 
WAIT 1000
 
CLEAR_AREA 988.9 -444.7 14.9 10.0 TRUE
 
CREATE_CHAR PEDTYPE_CIVMALE PED_SPECIAL1 988.7 -444.5 14.1 pervert1
SET_CHAR_HEADING pervert1 180.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_SPECIAL1 987.7 -444.3 13.9 pervert2
SET_CHAR_HEADING pervert2 140.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_SPECIAL1 986.9 -444.9 13.9 pervert3
SET_CHAR_HEADING pervert3 140.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_MALE2 990.4 -441.9 14.1 pervert4
SET_CHAR_HEADING pervert4 83.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_MALE2 991.1 -440.7 13.9 pervert5
SET_CHAR_HEADING pervert5 128.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_MALE2 992.1 -439.1 13.9 pervert6
SET_CHAR_HEADING pervert6 141.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_MALE2 992.0 -437.7 13.9 pervert7
SET_CHAR_HEADING pervert7 180.0
 
CREATE_CHAR PEDTYPE_CIVMALE PED_MALE2 992.1 -436.1 13.9 pervert8
SET_CHAR_HEADING pervert8 180.0
 
SET_FIXED_CAMERA_POSITION 982.705 -448.508 16.014 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 982.707 -447.632 16.496 JUMP_CUT
 
SET_CHAR_WAIT_STATE pervert1 WAITSTATE_CROSS_ROAD_LOOK 10000
SET_CHAR_WAIT_STATE pervert3 WAITSTATE_CROSS_ROAD_LOOK 10000
SET_CHAR_WAIT_STATE pervert2 WAITSTATE_CROSS_ROAD_LOOK 10000
 
SET_CHAR_AS_LEADER pervert1 pervert3
SET_CHAR_AS_LEADER pervert2 pervert3
 
DO_FADE 1000 FADE_IN
 
WAIT 2000
 
SET_FIXED_CAMERA_POSITION 986.596 -448.508 16.014 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 986.514 -447.632 16.496 INTERPOLATION
 
WAIT 3000
 
IF NOT IS_CHAR_DEAD pervert3
	SET_FIXED_CAMERA_POSITION 988.078 -445.869 16.3 0.0 0.0 0.0 
	POINT_CAMERA_AT_CHAR pervert3 FIXED INTERPOLATION
ENDIF
 
WAIT 3000
 
CLEAR_AREA 978.9 -444.4 14.9 3.0 TRUE
 
IF NOT IS_CHAR_DEAD	pervert3
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT pervert3 935.6 -445.8
ENDIF
 
WAIT 4000
 
SET_PED_DENSITY_MULTIPLIER 1.0
 
SET_FIXED_CAMERA_POSITION 994.524 -451.391 18.02 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 994.048 -450.563 17.724 INTERPOLATION
 
WAIT 6000
 
IF NOT IS_CHAR_DEAD	pervert3
	CHAR_WANDER_DIR pervert3 90
ENDIF
 
IF NOT IS_CHAR_DEAD	pervert2
	CHAR_WANDER_DIR pervert2 90
ENDIF
 
IF NOT IS_CHAR_DEAD	pervert1
	CHAR_WANDER_DIR pervert1 90		   
ENDIF
 
 
//PERVERTS CUT SCENE END******************************************************************
 
IF NOT IS_CAR_DEAD diablo_collect_porn_van
	IF IS_PLAYER_IN_CAR player diablo_collect_porn_van
		CLEAR_AREA 978.3 -442.7 13.9 1.0 TRUE
		WARP_PLAYER_FROM_CAR_TO_COORD player 978.3 -442.7 13.9
		SET_PLAYER_HEADING Player 180.0
	ELSE
		CLEAR_AREA 978.3 -442.7 13.9 1.0 TRUE
	   	SET_PLAYER_COORDINATES Player 978.3 -442.7 13.9
	   	SET_PLAYER_HEADING Player 180.0
	ENDIF
ENDIF
 
 
GOTO mission_diablo4_passed
 
}
 
 // Mission toni1 failed
 
mission_diablo4_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
// mission toni1 passed
 
mission_diablo4_passed:
 
flag_diablo_mission4_passed = 1
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) 20000 5000 1 //"Mission Passed!"
CLEAR_WANTED_LEVEL player
ADD_SCORE player 20000
CREATE_OBJECT donkeymag 895.2 -308.2 7.4 donkeymag1
DONT_REMOVE_OBJECT donkeymag1
CREATE_OBJECT donkeymag 896.1 -308.6 7.4 donkeymag2
DONT_REMOVE_OBJECT donkeymag2
CREATE_OBJECT donkeymag	890.1 -309.6 7.4 donkeymag3
DONT_REMOVE_OBJECT donkeymag3
SET_OBJECT_HEADING donkeymag1 260.0
SET_OBJECT_HEADING donkeymag2 280.0
SET_OBJECT_HEADING donkeymag3 190.0
flag_diablo_mission1_passed = 0
REMOVE_BLIP diablo_contact_blip
START_NEW_SCRIPT diablo_mission1_loop
REGISTER_MISSION_PASSED DIAB4
PLAYER_MADE_PROGRESS 1
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_diablo4:
 
flag_player_on_mission = 0
flag_player_on_diablo_mission = 0
REMOVE_BLIP blip1_porn_van
REMOVE_BLIP blip2_porn_shop
REMOVE_BLIP blip3_pornman
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_MAFIA_A
MARK_MODEL_AS_NO_LONGER_NEEDED PED_MALE2
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_RUMPO
CLEAR_ONSCREEN_TIMER counter_diablo4
CLEAR_PACMAN
SET_MUSIC_DOES_FADE TRUE
UNLOAD_SPECIAL_CHARACTER 1
	IF flag_asuka_mission1_passed = 1
		SET_GANG_WEAPONS GANG_MAFIA WEAPONTYPE_PISTOL WEAPONTYPE_SHOTGUN //The Mafia
	ENDIF
MISSION_HAS_FINISHED
RETURN
п · о · р
GTA III Grand Theft Auto III
Форматы файлов.b.a3d.anm.col.cfg.dff.dat.gxt.ide.ifp.img/.dir.ipl.raw/.sdt.rep.sc.scm.set.txd.zon
Документацияcarcols.datCHASE.DATCULLZONE.DATcuts.imgdefault.datfistfite.datflight.datgta3.exegta3.dat
gta3.imggta3.zonhandling.cfgmain.scmmap.datmap.zonobject.datparticle.cfgped.datpedgrp.dat
pedstats.datsfx.rawsurface.datTimeCyc.DATtracks.dattrain.datwater.datwaterpro.datweapon.dat
ИнструментыCLEOClump ViewerCol-IO‎Collision File Editor IIData toolDFF Viewerdffxbox2pcG-ToolsGTA Garage Mod Manager
GXT EditorGTA3 Limit AdjusterGTA3 Mission BuilderGTA3 PatcherIMG ToolKam's Max ScriptsMap Editor
Mod GeneratorMod InstallerMoo MapperPS2 TXD ModPS2 TXD ViewerResourse HackerRotation Calculator
RW AnalyzeViceTXDWater EditorSanny BuilderTXD ToolTXD WorkshopYAIEZModeler
Туториалыраздел в разработке
Классические МодыGPS RadarBye-Bye BikiniUltimate Stunt ParkThe SphereMiss LibertyIllandoIntercity HighwayShoreside Bridge
Rockstar HeightsLighthouse BridgeBlade FunparkOrbital CityLakeside IslandLiberty PenitentiaryJEM Island
Illando HelixCliff Climbing Mountain
Глобальные МодыReal GTA3Twenty TenSnow CityFrosted WinterUltimateBeta modX-box modBad BusinessGTA3 HDUltra mod
OpenTunnelsBack to the Future
МультиплеерMulti Theft AutoLiberty Unleashed
Исходники4x48ballambulanceasukaasusbcameracar_gencatcopcardebugdemodiablofiretruckfrankgates
genstufhealthhjhoodimportintrojoeykenjiloveluigimayhemmeatpickupsrampagerayrcswitch
taxitoniusjwantedyard