Joey

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

Содержание

joey1

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Joey mission 1****************************************
// ************************************Kill Mike Lips*****************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff
 
GOSUB mission_start_joey1
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey1_failed
ENDIF
 
GOSUB mission_cleanup_joey1
 
MISSION_END
 
 
// Variables for mission
 
VAR_INT mike_car // mission specific ped
 
VAR_FLOAT mikes_car_heading	
 
VAR_INT blip1_jm1 blip2_jm1 blip3_jm1 blip4_jm1
 
VAR_INT flag_player_got_joey1_message flag_car_blip_displayed_jm1
 
VAR_INT flag_displayed_wanted_message_jm1
 
VAR_INT countdown_jm1 mission_passed_for_lips_finished
 
 
// ***************************************Mission Start*************************************
 
mission_start_joey1:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
mission_passed_for_lips_finished = 0
SCRIPT_NAME joey1
WAIT 0
 
flag_displayed_wanted_message_jm1 = 0
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_CHARACTER 2 misty
LOAD_SPECIAL_MODEL cut_obj1 JOEDOOR
LOAD_SPECIAL_MODEL cut_obj2 JOEYH
LOAD_SPECIAL_MODEL cut_obj3 PLAYERH
LOAD_SPECIAL_MODEL cut_obj4 MISTYH
REQUEST_MODEL CAR_IDAHO
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_SPECIAL_CHARACTER_LOADED 2
OR NOT HAS_MODEL_LOADED CAR_IDAHO
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED cut_obj3
OR NOT HAS_MODEL_LOADED cut_obj4
	WAIT 0
 
ENDWHILE
 
LOAD_CUTSCENE J1_LFL
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977
 
CREATE_CAR CAR_IDAHO 1182.5 -857.0 14.1 cut_car2_lm3
SET_CAR_HEADING cut_car2_lm3 291.2
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL2 cs_misty
SET_CUTSCENE_ANIM cs_misty misty
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ2 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_misty CUT_OBJ4 cs_mistyhead
SET_CUTSCENE_HEAD_ANIM cs_mistyhead misty
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ3 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT cut_obj1 cs_joedoor
SET_CUTSCENE_ANIM cs_joedoor JOEDOOR
 
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 FALSE
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 FALSE
 
CLEAR_AREA 1191.9 -870.4 15.0 1.0 TRUE
SET_PLAYER_COORDINATES player 1191.9 -870.4 -100.0
 
SET_PLAYER_HEADING player 230.0
 
DO_FADE 1500 FADE_IN
 
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
GET_CUTSCENE_TIME cs_time
 
 
WHILE cs_time < 433
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_A ) 10000 2 // Mission brief
 
WHILE cs_time < 2739
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_B ) 10000 2 // Mission brief
 
WHILE cs_time < 6344
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_C ) 10000 2 // Mission brief
 
WHILE cs_time < 8362
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_D ) 10000 2 // Mission brief
 
WHILE cs_time < 10700
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_E ) 10000 2 // Mission brief
 
WHILE cs_time < 12688
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_F ) 10000 2 // Mission brief
 
WHILE cs_time < 15858
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_G ) 10000 2 // Mission brief
 
WHILE cs_time < 19969
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_H ) 10000 2 // Mission brief
 
WHILE cs_time < 21519
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_I ) 3000 2 // Mission brief
 
WHILE cs_time < 24979
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_J ) 10000 2 // Mission brief
 
WHILE cs_time < 27466
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM1_K ) 10000 2 // Mission brief
 
WHILE cs_time < 29204
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 30000
	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
 
SWITCH_RUBBISH ON
CLEAR_CUTSCENE
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 TRUE
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 TRUE
SET_CAMERA_IN_FRONT_OF_PLAYER
 
ADD_SPRITE_BLIP_FOR_COORD 1282.0 -104.0 -100.0 RADAR_SPRITE_BOMB blip2_jm1
ADD_SPRITE_BLIP_FOR_COORD 925.0 -359.5 -100.0 RADAR_SPRITE_SPRAY blip4_jm1
ADD_BLIP_FOR_COORD 1335.0 -455.0 -100.0 blip3_jm1
REMOVE_BLIP	blip2_jm1
REMOVE_BLIP	blip3_jm1
REMOVE_BLIP	blip4_jm1
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
 
UNLOAD_SPECIAL_CHARACTER 1
UNLOAD_SPECIAL_CHARACTER 2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ4
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_IDAHO
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
DELETE_CAR cut_car2_lm3
 
 
// START OF MISSION
 
LOAD_SPECIAL_CHARACTER 3 lips
REQUEST_MODEL CAR_IDAHO
 
	WHILE NOT HAS_MODEL_LOADED CAR_IDAHO
	OR NOT HAS_SPECIAL_CHARACTER_LOADED 3
		WAIT 0
 
	ENDWHILE
 
IF timer_help_message_displayed	= 0
	PRINT_HELP ( TIMER )
	timer_help_message_displayed = 1
ENDIF
 
CREATE_CAR CAR_IDAHO 1336.2 -460.8 -100.0 mike_car
MAKE_CRAIGS_CAR_A_BIT_STRONGER mike_car TRUE
LOCK_CAR_DOORS mike_car CARLOCK_FORCE_SHUT_DOORS
SET_CAR_HEADING mike_car 90.0
SET_CAN_RESPRAY_CAR mike_car OFF
ADD_BLIP_FOR_CAR mike_car blip1_jm1
countdown_jm1 = 361000
DISPLAY_ONSCREEN_TIMER countdown_jm1
 
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
 
WHILE NOT IS_PLAYER_IN_CAR player mike_car
	WAIT 0
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN mike_car
	AND IS_CAR_STOPPED mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF countdown_jm1 = 0
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
ENDWHILE 
 
 
PRINT_NOW ( JM1_1 ) 5000 1 //"Go to 8 Balls"
 
SET_FREE_BOMBS On
 
 
Go_to_8Balls:
 
flag_car_blip_displayed_jm1 = TRUE
 
WHILE NOT IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITION
AND NOT IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITIONACTIVE
	WAIT 0
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN mike_car
	AND IS_CAR_STOPPED mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF countdown_jm1 = 0
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_PLAYER_IN_CAR player mike_car
		IF flag_car_blip_displayed_jm1 = TRUE
			IF NOT IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITIONACTIVE
			OR NOT IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITION
				REMOVE_BLIP blip2_jm1
				ADD_SPRITE_BLIP_FOR_COORD 1282.0 -104.0 -100.0 RADAR_SPRITE_BOMB blip2_jm1
				REMOVE_BLIP blip1_jm1
			ENDIF
		flag_car_blip_displayed_jm1 = FALSE
		ENDIF
	ENDIF
 
	IF NOT IS_PLAYER_IN_CAR player mike_car
		IF flag_car_blip_displayed_jm1 = FALSE
		ADD_BLIP_FOR_CAR mike_car blip1_jm1
		REMOVE_BLIP blip2_jm1
		PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
		flag_car_blip_displayed_jm1 = TRUE
		ENDIF
	ENDIF
 
	IF NOT IS_CAR_HEALTH_GREATER mike_car 700
	OR IS_CAR_VISIBLY_DAMAGED mike_car
		PRINT_SOON ( JM1_4 ) 5000 2 //Repair the car!
			REMOVE_BLIP blip1_jm1
			ADD_BLIP_FOR_CAR mike_car blip1_jm1
			CHANGE_BLIP_DISPLAY blip1_jm1 BLIP_ONLY
			flag_car_blip_displayed_jm1 = TRUE
 
				WHILE IS_CAR_VISIBLY_DAMAGED mike_car
					WAIT 0 
 
					IF IS_CAR_DEAD mike_car
						PRINT_NOW ( WRECKED ) 5000 1
						GOTO mission_joey1_failed
					ENDIF
 
					IF IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITIONACTIVE
					OR IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITION
						REMOVE_BLIP blip2_jm1
					ENDIF
 
					IF IS_CAR_UPSIDEDOWN mike_car
					AND IS_CAR_STOPPED mike_car
						PRINT_NOW ( WRECKED ) 5000 1
						GOTO mission_joey1_failed
					ENDIF
 
					IF countdown_jm1 = 0
						PRINT_NOW ( OUTTIME ) 5000 1
						GOTO mission_joey1_failed
					ENDIF
 
					IF IS_PLAYER_IN_CAR player mike_car
						IF flag_car_blip_displayed_jm1 = TRUE
							REMOVE_BLIP	blip4_jm1
							ADD_SPRITE_BLIP_FOR_COORD 925.0 -359.5 -100.0 RADAR_SPRITE_SPRAY blip4_jm1
							REMOVE_BLIP blip1_jm1
						flag_car_blip_displayed_jm1 = FALSE
						ENDIF
					ENDIF
 
					IF NOT IS_PLAYER_IN_CAR player mike_car
						IF flag_car_blip_displayed_jm1 = FALSE
						ADD_BLIP_FOR_CAR mike_car blip1_jm1
						REMOVE_BLIP blip4_jm1
						PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
						flag_car_blip_displayed_jm1 = TRUE
						ENDIF
					ENDIF
 
				ENDWHILE
 
			REMOVE_BLIP blip4_jm1
			GOTO Go_to_8Balls
	ENDIF
 
ENDWHILE
 
	WAIT 4000
 
	PRINT_NOW ( jm1_2 ) 5000 2 // Car rigged
	REMOVE_BLIP blip1_jm1
	REMOVE_BLIP blip2_jm1
	REMOVE_BLIP blip4_jm1
 
one_before_joey_label1:
 
	SET_FREE_BOMBS Off
 
joey_label1: //Drop the car back at the bistro
 
WAIT 0
flag_car_blip_displayed_jm1 = TRUE
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
blob_flag = 1
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D mike_car 1339.6 -459.5 49.0 1332.8 -462.8 53.0 blob_flag
OR IS_WANTED_LEVEL_GREATER Player 0
OR IS_CAR_VISIBLY_DAMAGED mike_car
	WAIT 0
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN mike_car
	AND IS_CAR_STOPPED mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF countdown_jm1 = 0
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_PLAYER_IN_CAR player mike_car
		IF flag_car_blip_displayed_jm1 = TRUE
			REMOVE_BLIP	blip3_jm1
			ADD_BLIP_FOR_COORD 1335.0 -455.0 -100.0 blip3_jm1
			REMOVE_BLIP blip1_jm1
			blob_flag = 1
		flag_car_blip_displayed_jm1 = FALSE
		ENDIF
	ENDIF
 
	IF NOT IS_PLAYER_IN_CAR player mike_car
		IF flag_car_blip_displayed_jm1 = FALSE
		ADD_BLIP_FOR_CAR mike_car blip1_jm1
		REMOVE_BLIP blip3_jm1
		PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
		blob_flag = 0
		flag_car_blip_displayed_jm1 = TRUE
		ENDIF
	ENDIF
 
	IF NOT IS_CAR_HEALTH_GREATER mike_car 700
	OR IS_CAR_VISIBLY_DAMAGED mike_car
		PRINT_SOON ( JM1_4 ) 5000 2 //Repair the car!
		REMOVE_BLIP blip3_jm1
		REMOVE_BLIP blip1_jm1
		ADD_BLIP_FOR_CAR mike_car blip1_jm1
		CHANGE_BLIP_DISPLAY blip1_jm1 BLIP_ONLY
		flag_car_blip_displayed_jm1 = TRUE
 
			WHILE IS_CAR_VISIBLY_DAMAGED mike_car
				WAIT 0 
 
				IF IS_CAR_DEAD mike_car
					PRINT_NOW ( WRECKED ) 5000 1
					GOTO mission_joey1_failed
				ENDIF
 
				IF IS_CAR_UPSIDEDOWN mike_car
				AND IS_CAR_STOPPED mike_car
					PRINT_NOW ( WRECKED ) 5000 1
					GOTO mission_joey1_failed
				ENDIF
 
				IF countdown_jm1 = 0
					PRINT_NOW ( OUTTIME ) 5000 1
					GOTO mission_joey1_failed
				ENDIF
 
				IF IS_PLAYER_IN_CAR player mike_car
					IF flag_car_blip_displayed_jm1 = TRUE
						REMOVE_BLIP	blip4_jm1
						ADD_SPRITE_BLIP_FOR_COORD 925.0 -359.5 -100.0 RADAR_SPRITE_SPRAY blip4_jm1
						REMOVE_BLIP blip1_jm1
						blob_flag = 1
					flag_car_blip_displayed_jm1 = FALSE
					ENDIF
				ENDIF
 
				IF NOT IS_PLAYER_IN_CAR player mike_car
					IF flag_car_blip_displayed_jm1 = FALSE
					ADD_BLIP_FOR_CAR mike_car blip1_jm1
					REMOVE_BLIP blip4_jm1
					PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
					blob_flag = 0
					flag_car_blip_displayed_jm1 = TRUE
					ENDIF
				ENDIF
 
			ENDWHILE
 
		REMOVE_BLIP blip4_jm1
		GOTO joey_label1
	ENDIF
 
	IF IS_PLAYER_IN_AREA_IN_CAR_3D player 1339.6 -459.5 49.0 1332.8 -462.8 53.0 FALSE
		IF IS_WANTED_LEVEL_GREATER player 0
			IF flag_displayed_wanted_message_jm1 = 0
				PRINT_NOW ( WANTED1 ) 4000 1
				flag_displayed_wanted_message_jm1 = 1
			ENDIF
		ENDIF
	ELSE
		IF NOT IS_PLAYER_IN_AREA_3D player 1339.6 -459.5 49.0 1332.8 -462.8 53.0 FALSE
			flag_displayed_wanted_message_jm1 = 0
		ENDIF
	ENDIF
 
ENDWHILE
 
 
REMOVE_BLIP blip1_jm1
REMOVE_BLIP blip2_jm1
REMOVE_BLIP blip3_jm1
REMOVE_BLIP blip4_jm1
 
IF countdown_jm1 = 0
	PRINT_NOW ( OUTTIME ) 5000 1
	GOTO mission_joey1_failed
ENDIF
 
IF NOT IS_CAR_DEAD mike_car
 
	GET_CAR_HEADING mike_car mikes_car_heading
	IF mikes_car_heading > 100.0
	OR mikes_car_heading < 80.0
		PRINT_NOW ( JM1_6 ) 5000 1 //Put the car back in the correct position
		GOTO joey_label1
	ENDIF 
 
	IF IS_PLAYER_IN_CAR	player mike_car
		PRINT_NOW ( JM1_3 ) 5000 2 //Activate the car bomb then get out of there!
	ENDIF
 
ENDIF
 
cars_rigged:
WAIT 0
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D mike_car 1339.6 -459.5 49.0 1332.8 -462.8 53.0 TRUE
OR IS_PLAYER_IN_AREA_3D player 1306.0 -482.0 49.0 1350.0 -444.0 59.0 FALSE
OR NOT IS_PLAYER_IN_AREA_3D player 1306.0 -484.0 49.0 1370.0 -434.0 69.0 FALSE 
 
	WAIT 0
 
	IF IS_CAR_DEAD mike_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN mike_car
	AND IS_CAR_STOPPED mike_car		
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF countdown_jm1 = 0
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF NOT IS_CAR_IN_AREA_3D mike_car 1339.6 -459.5 49.0 1332.8 -462.8 53.0 FALSE
		PRINT_NOW ( JM1_6 ) 5000 1
		GOTO joey_label1
	ENDIF
 
	GET_CAR_HEADING mike_car mikes_car_heading
	IF mikes_car_heading > 100.0
	OR mikes_car_heading < 80.0
		PRINT_NOW ( JM1_6 ) 5000 1
		GOTO joey_label1
	ENDIF 
 
	IF NOT IS_CAR_HEALTH_GREATER mike_car 700
	OR IS_CAR_VISIBLY_DAMAGED mike_car
		GOTO joey_label1
	ENDIF
 
ENDWHILE
 
 
	IF countdown_jm1 = 0
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey1_failed
	ENDIF
 
	IF NOT IS_CAR_ARMED_WITH_BOMB mike_car CARBOMB_ONIGNITIONACTIVE
 		PRINT_NOW ( JM1_5 ) 5000 1 // The vehicle bomb's not set!
		GOTO cars_rigged
	ENDIF
 
 
 
//LIPS CUT_SCENE
 
CLEAR_AREA 1325.5 -452.5 54.0 4.0 TRUE
CLEAR_AREA 1328.4 -453.0 54.0 4.0 TRUE
CLEAR_AREA 1330.0 -466.1 49.0 4.0 TRUE
CLEAR_AREA 1333.6 -465.3 49.0 4.0 TRUE
 
CLEAR_ONSCREEN_TIMER countdown_jm1
SET_POLICE_IGNORE_PLAYER Player On
SET_PLAYER_CONTROL Player Off
SWITCH_WIDESCREEN ON
 
 
CREATE_CHAR PEDTYPE_SPECIAL PED_SPECIAL3 1325.5 -452.5 -100.0 lips
SET_CHAR_HEADING lips 270.0
 
SET_FIXED_CAMERA_POSITION 1337.814 -468.631 49.774 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1337.053 -468.016 49.982 JUMP_CUT
 
SET_CHAR_OBJ_GOTO_COORD_ON_FOOT lips 1328.4 -453.0
 
IF IS_CHAR_DEAD lips
	GOTO mission_joey1_passed
ENDIF
 
TIMERB = 0
 
IF NOT IS_CHAR_DEAD lips
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED lips
		WAIT 0
 
			IF IS_CAR_DEAD mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CAR_UPSIDEDOWN mike_car
			AND IS_CAR_STOPPED mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CHAR_DEAD lips
				GOTO mission_joey1_passed
			ENDIF
 
			IF TIMERB > 10000
				IF NOT IS_CHAR_DEAD	lips
					SET_CHAR_COORDINATES lips 1328.4 -453.0 -100.0
				ENDIF
			ENDIF
 
	ENDWHILE
 
ENDIF
 
 
TIMERB = 0
 
IF NOT IS_CHAR_DEAD lips
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT lips 1330.0 -466.1
ENDIF
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED lips
		WAIT 0
 
			IF IS_CAR_DEAD mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CAR_UPSIDEDOWN mike_car
			AND IS_CAR_STOPPED mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CHAR_DEAD lips
				GOTO mission_joey1_passed
			ENDIF
 
			IF TIMERB > 10000
				IF NOT IS_CHAR_DEAD	lips
					SET_CHAR_COORDINATES lips 1330.0 -466.1 -100.0
				ENDIF
			ENDIF
 
	ENDWHILE
 
 
TIMERB = 0
 
IF NOT IS_CHAR_DEAD lips
	SET_CHAR_OBJ_GOTO_COORD_ON_FOOT lips 1333.6 -465.3
ENDIF
 
SET_FIXED_CAMERA_POSITION 1344.8 -471.2 54.0 0.0 0.0 0.0
 
	IF NOT IS_CAR_DEAD mike_car
		POINT_CAMERA_AT_CAR mike_car FIXED JUMP_CUT	
	ENDIF
 
IF NOT IS_CHAR_DEAD lips
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED lips
		WAIT 0
 
			IF IS_CAR_DEAD mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CAR_UPSIDEDOWN mike_car
			AND IS_CAR_STOPPED mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CHAR_DEAD lips
				GOTO mission_joey1_passed
			ENDIF
 
			IF TIMERB > 10000
				IF NOT IS_CHAR_DEAD	lips
					SET_CHAR_COORDINATES lips 1333.6 -465.3 -100.0
				ENDIF
			ENDIF
 
	ENDWHILE
 
ENDIF
 
IF NOT IS_CHAR_DEAD lips
AND	NOT IS_CAR_DEAD mike_car
	SET_CHAR_OBJ_ENTER_CAR_AS_DRIVER lips mike_car
ENDIF
 
	WHILE NOT IS_CHAR_IN_CAR lips mike_car
		WAIT 0
 
			IF IS_CAR_DEAD mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CAR_UPSIDEDOWN mike_car
			AND IS_CAR_STOPPED mike_car
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey1_failed
			ENDIF
 
			IF IS_CHAR_DEAD lips
				GOTO mission_joey1_passed
			ENDIF
 
	ENDWHILE
 
SET_ALL_CARS_CAN_BE_DAMAGED TRUE
 
WAIT 2500
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) 10000 5000 1 //"Mission Passed!"
ADD_SCORE player 10000
mission_passed_for_lips_finished = 1
WAIT 5000
 
SET_PLAYER_CONTROL Player On
SWITCH_WIDESCREEN OFF
SET_POLICE_IGNORE_PLAYER Player Off
 
}
 
GOTO mission_joey1_passed
 
 
 // Mission joey1 failed
 
mission_joey1_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission joey1 passed
 
mission_joey1_passed:
 
flag_joey_mission1_passed = 1
 
IF mission_passed_for_lips_finished	= 0
	PLAY_MISSION_PASSED_TUNE 1
	PRINT_WITH_NUMBER_BIG ( M_PASS ) 10000 5000 1 //"Mission Passed!"
	ADD_SCORE player 10000
	mission_passed_for_lips_finished = 1
ENDIF
 
REGISTER_MISSION_PASSED JM1
PLAYER_MADE_PROGRESS 1
REMOVE_CHAR_ELEGANTLY lips
START_NEW_SCRIPT joey_mission2_loop
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_joey1:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
REMOVE_BLIP blip1_jm1
REMOVE_BLIP blip2_jm1
REMOVE_BLIP blip3_jm1
REMOVE_BLIP blip4_jm1
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_IDAHO
UNLOAD_SPECIAL_CHARACTER 3
CLEAR_ONSCREEN_TIMER countdown_jm1
IF NOT IS_CAR_DEAD mike_car
	SET_CAN_RESPRAY_CAR mike_car ON
	LOCK_CAR_DOORS mike_car CARLOCK_UNLOCKED
	MAKE_CRAIGS_CAR_A_BIT_STRONGER mike_car FALSE
ENDIF
SET_FREE_BOMBS Off
MISSION_HAS_FINISHED
RETURN

joey2

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Joey mission 2****************************************
// ************************************Kill Chunky Dave***************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff
 
GOSUB mission_start_joey2
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey2_failed
ENDIF
 
GOSUB mission_cleanup_joey2
 
MISSION_END
 
 
// Variables for mission
 
 
VAR_INT chunkys_car chunkys_car2// mission specific ped
 
VAR_INT blip1_jm2 blip2_jm2 //blip3_jm2 
 
VAR_INT chunky_mate1 chunky_mate2 chunky_mate3 
 
VAR_INT mate1health mate2health mate3health chunkyhealth
 
VAR_INT been_in_shop_before noodle_stand gun_chunky
 
VAR_INT flag_gun_message_jm2 has_audio_been_activated
 
//VAR_INT test_car_health_counter
 
//VAR_INT flag_player_got_joey2_message
 
 
// ***************************************Mission Start*************************************
 
mission_start_joey2:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
SCRIPT_NAME joey2
WAIT 0
 
flag_gun_message_jm2 = 0
has_audio_been_activated = 0
 
/*
IF CAN_PLAYER_START_MISSION Player
	MAKE_PLAYER_SAFE_FOR_CUTSCENE Player
ELSE
	GOTO mission_joey2_failed
ENDIF
 
SET_FADING_COLOUR 0 0 0
 
DO_FADE 1500 FADE_OUT
 
SWITCH_STREAMING OFF
 
PRINT_BIG ( JM2 ) 15000 2 //"Joey Mission 2"
*/
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_MODEL cut_obj1 JOEYH
LOAD_SPECIAL_MODEL cut_obj2 PLAYERH
LOAD_SPECIAL_MODEL cut_obj3 TROLL
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
/*
WHILE GET_FADING_STATUS
	WAIT 0
 
ENDWHILE
*/
 
//LOAD_SCENE 1190.07 -869.86 13.97
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED	cut_obj3
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
	WAIT 0
ENDWHILE
 
LOAD_CUTSCENE J2_KCL
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ1 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ2 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT CUT_OBJ3 cs_troll
SET_CUTSCENE_ANIM cs_troll TROLL
 
//SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 FALSE
//SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 FALSE
 
CLEAR_AREA 1191.9 -870.4 15.0 1.0 TRUE
SET_PLAYER_COORDINATES player 1191.9 -870.4 -100.0
 
SET_PLAYER_HEADING player 230.0
 
DO_FADE 1500 FADE_IN
 
//SWITCH_WORLD_PROCESSING OFF
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
GET_CUTSCENE_TIME cs_time
 
 
WHILE cs_time < 5118
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_A ) 10000 2 // Mission brief
 
WHILE cs_time < 10669
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_B ) 10000 2 // Mission brief
 
WHILE cs_time < 13048
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_C ) 10000 2 // Mission brief
 
WHILE cs_time < 15427
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_D ) 10000 2 // Mission brief
 
WHILE cs_time < 17662
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_E ) 10000 2 // Mission brief
 
WHILE cs_time < 18887
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_F ) 10000 2 // Mission brief
 
WHILE cs_time < 22708
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_G ) 10000 2 // Mission brief
 
WHILE cs_time < 25159
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM2_H ) 10000 2 // Mission brief
 
WHILE cs_time < 28982
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 31000
	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
 
//SWITCH_WORLD_PROCESSING ON
SWITCH_RUBBISH ON
CLEAR_CUTSCENE
//SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 TRUE
//SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 TRUE
SET_CAMERA_IN_FRONT_OF_PLAYER
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
UNLOAD_SPECIAL_CHARACTER 1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
LOAD_SPECIAL_CHARACTER 2 chunky
REQUEST_MODEL PED_GANG_TRIAD_A
REQUEST_MODEL CAR_PERENNIAL
 
	WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 2
	OR NOT HAS_MODEL_LOADED PED_GANG_TRIAD_A
	OR NOT HAS_MODEL_LOADED CAR_PERENNIAL
		WAIT 0
	ENDWHILE
 
//ADD_BLIP_FOR_COORD 1080.0 -397.0 -100.0 blip2_jm2
 
CREATE_PICKUP_WITH_AMMO WEAPON_COLT45 PICKUP_ONCE 45 1080.5 -396.0 -100.0 gun_chunky
ADD_SPRITE_BLIP_FOR_PICKUP gun_chunky RADAR_SPRITE_WEAPON blip2_jm2
 
CREATE_OBJECT noodlesbox 975.0 -720.0 14.0 noodle_stand  
 
 
// START OF MISSION
 
CREATE_CAR CAR_PERENNIAL 1007.1 -756.4 14.5 chunkys_car
SET_CAR_HEADING chunkys_car 120.0
//LOCK_CAR_DOORS chunkys_car CARLOCK_LOCKOUT_PLAYER_ONLY
 
CREATE_CAR CAR_PERENNIAL 912.3 -686.1 14.5 chunkys_car2
SET_CAR_HEADING chunkys_car2 90.0
//LOCK_CAR_DOORS chunkys_car2 CARLOCK_LOCKOUT_PLAYER_ONLY
 
CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 976.1 -715.3 14.2 chunky_mate1
SET_CHAR_HEADING chunky_mate1 346.0
GIVE_WEAPON_TO_CHAR chunky_mate1 WEAPONTYPE_BASEBALLBAT 0
SET_CHAR_OBJ_GUARD_SPOT chunky_mate1 976.1 -715.3 14.2
SET_CHAR_PERSONALITY chunky_mate1 PEDSTAT_TOUGH_GUY
 
CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 975.7 -724.7 14.2 chunky_mate2
SET_CHAR_HEADING chunky_mate2 222.0
GIVE_WEAPON_TO_CHAR chunky_mate2 WEAPONTYPE_BASEBALLBAT 0
SET_CHAR_OBJ_GUARD_SPOT chunky_mate2 975.7 -724.7 14.2
SET_CHAR_PERSONALITY chunky_mate2 PEDSTAT_TOUGH_GUY
 
CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 984.0 -727.7 14.2 chunky_mate3
SET_CHAR_HEADING chunky_mate3 243.0
GIVE_WEAPON_TO_CHAR chunky_mate3 WEAPONTYPE_PISTOL 100
SET_CHAR_OBJ_GUARD_SPOT chunky_mate3 984.0 -727.7 14.2
SET_CHAR_PERSONALITY chunky_mate3 PEDSTAT_TOUGH_GUY
 
CREATE_CHAR PEDTYPE_SPECIAL PED_SPECIAL2 975.3 -720.4 14.2 chunky
SET_CHAR_HEADING chunky 270.0
ADD_BLIP_FOR_CHAR chunky blip1_jm2
SET_CHAR_OBJ_WAIT_ON_FOOT chunky
SET_CHAR_PERSONALITY chunky PEDSTAT_GEEK_GUY
SET_CHAR_RUNNING chunky TRUE
//SET_CHAR_HEALTH chunky 100
ADD_ARMOUR_TO_CHAR chunky 100
CHANGE_BLIP_DISPLAY blip1_jm2 BLIP_ONLY
SET_ANIM_GROUP_FOR_CHAR chunky ANIM_PANIC_CHUNKYPED 
 
WHILE NOT LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player chunky 25.0 26.0 4.0 FALSE
	WAIT 0
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		GOSUB controller_modes
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
		IF NOT IS_CHAR_DEAD chunky
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky True
			GET_CHAR_HEALTH	chunky chunkyhealth
		ENDIF
		IF NOT IS_CHAR_DEAD chunky_mate1
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate1 True
			GET_CHAR_HEALTH chunky_mate1 mate1health
		ENDIF
		IF NOT IS_CHAR_DEAD	chunky_mate2
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate2 True
			GET_CHAR_HEALTH chunky_mate2 mate2health
		ENDIF
		IF NOT IS_CHAR_DEAD	chunky_mate3
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate3 True
			GET_CHAR_HEALTH chunky_mate3 mate3health
		ENDIF
 
		IF mate1health < 99
		OR mate2health < 99
		OR mate3health < 99
		OR chunkyhealth < 99
			GOTO kill_and_run
		ENDIF
 
	   	IF IS_CHAR_DEAD chunky_mate1
		OR IS_CHAR_DEAD chunky_mate2
		OR IS_CHAR_DEAD chunky_mate3
			GOTO kill_and_run
		ENDIF
 
ENDWHILE
 
SET_POLICE_IGNORE_PLAYER Player ON
SET_PLAYER_CONTROL Player OFF
SWITCH_WIDESCREEN ON
SET_PED_DENSITY_MULTIPLIER 0.0
 
//SET_FIXED_CAMERA_POSITION 977.756 -719.673 16.206 0.0 0.0 0.0
SET_FIXED_CAMERA_POSITION 984.819 -704.631 21.468 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 984.279 -705.429 21.202 JUMP_CUT
 
//IF NOT IS_CHAR_DEAD	chunky
//	POINT_CAMERA_AT_CHAR chunky FIXED JUMP_CUT
//ENDIF
 
WAIT 3000
 
SET_FIXED_CAMERA_POSITION 978.135 -718.497 15.642 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 977.293 -719.016 15.794 JUMP_CUT
 
//SET_FIXED_CAMERA_POSITION 984.1 -714.9 17.4 0.0 0.0 0.0 
//IF NOT IS_CHAR_DEAD	chunky
//	POINT_CAMERA_AT_CHAR chunky FIXED INTERPOLATION
//ENDIF
 
WAIT 3000
 
SET_PED_DENSITY_MULTIPLIER 1.0
SET_POLICE_IGNORE_PLAYER Player OFF
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA_JUMPCUT
//REMOVE_BLIP blip3_jm2
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
WHILE NOT LOCATE_PLAYER_ANY_MEANS_CHAR_3D Player chunky 20.0 18.0 4.0 FALSE
 
	WAIT 0
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		GOSUB controller_modes
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
		IF NOT IS_CHAR_DEAD chunky
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky True
			GET_CHAR_HEALTH	chunky chunkyhealth
		ENDIF
		IF NOT IS_CHAR_DEAD chunky_mate1
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate1 True
			GET_CHAR_HEALTH chunky_mate1 mate1health
		ENDIF
		IF NOT IS_CHAR_DEAD	chunky_mate2
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate2 True
			GET_CHAR_HEALTH chunky_mate2 mate2health
		ENDIF
		IF NOT IS_CHAR_DEAD	chunky_mate3
			SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate3 True
			GET_CHAR_HEALTH chunky_mate3 mate3health
		ENDIF
 
		IF mate1health < 99
		OR mate2health < 99
		OR mate3health < 99
		OR chunkyhealth < 99
			GOTO kill_and_run
		ENDIF
 
		IF IS_CHAR_DEAD chunky_mate1
		OR IS_CHAR_DEAD chunky_mate2
		OR IS_CHAR_DEAD chunky_mate3
			GOTO kill_and_run
		ENDIF
 
ENDWHILE
 
kill_and_run:
 
//REMOVE_BLIP blip3_jm2
 
CHANGE_BLIP_DISPLAY blip1_jm2 BOTH
 
	IF NOT IS_CHAR_DEAD chunky_mate1
		SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT chunky_mate1 Player
		SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate1 false
		SET_CHAR_THREAT_SEARCH chunky_mate1 THREAT_PLAYER1	
	ENDIF
 
	IF NOT IS_CHAR_DEAD chunky_mate2
		SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT chunky_mate2 Player
		SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate2 false
		SET_CHAR_THREAT_SEARCH chunky_mate2 THREAT_PLAYER1
	ENDIF
 
	IF NOT IS_CHAR_DEAD chunky_mate3
		SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT chunky_mate3 Player
		SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky_mate3 false
		SET_CHAR_THREAT_SEARCH chunky_mate3 THREAT_PLAYER1
	ENDIF
 
	IF NOT IS_CHAR_DEAD chunky	
		SET_CHAR_HEED_THREATS chunky False
		SET_CHAR_ONLY_DAMAGED_BY_PLAYER chunky false
	ENDIF
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 975.5 -722.9
 
TIMERB = 0
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		GOSUB pickup_and_audio
 
ENDWHILE
 
 
IF IS_PLAYER_IN_AREA_2D	player 974.2 -727.5	1003.4 -748.8 FALSE
	GOTO run_the_other_way
ENDIF
 
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 985.1 -733.9
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		GOSUB pickup_and_audio
 
ENDWHILE
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 1004.2 -736.9
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		GOSUB pickup_and_audio
 
ENDWHILE
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 1006.3 -753.2
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		GOSUB pickup_and_audio
 
ENDWHILE
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	IF IS_CAR_DEAD chunkys_car
		GOTO fuckin_run_for_it
	ELSE
		IF NOT IS_CAR_IN_AREA_2D chunkys_car 1004.0 -738.0 1012.0 -763.0 FALSE
		OR NOT IS_CAR_HEALTH_GREATER chunkys_car 300
			GOTO fuckin_run_for_it
		ENDIF
	ENDIF
 
SET_CHAR_OBJ_ENTER_CAR_AS_DRIVER chunky chunkys_car
 
WHILE NOT IS_CHAR_IN_CAR chunky chunkys_car
	WAIT 0
 
		IF IS_CAR_DEAD chunkys_car
			GOTO fuckin_run_for_it
		ELSE
 
			IF NOT IS_CAR_IN_AREA_2D chunkys_car 1004.0 -738.0 1012.0 -763.0 FALSE
			OR NOT IS_CAR_HEALTH_GREATER chunkys_car 300
				GOTO fuckin_run_for_it
			ENDIF
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
ENDWHILE
 
	IF NOT IS_CAR_DEAD chunkys_car
		CAR_WANDER_RANDOMLY chunkys_car
		SET_CAR_DRIVING_STYLE chunkys_car 2
		SET_CAR_CRUISE_SPEED chunkys_car 20.0
		//LOCK_CAR_DOORS chunkys_car CARLOCK_UNLOCKED
	ENDIF
 
//DISPLAY_ONSCREEN_COUNTER test_car_health_counter //TEST STUFF!!!!!!!!!!!!!
 
WHILE IS_CAR_HEALTH_GREATER chunkys_car 300
	WAIT 0 
 
		GOSUB controller_modes
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		IF IS_CAR_DEAD chunkys_car
			GOTO mission_joey2_passed
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player chunky 160.0 160.0 FALSE
			PRINT_NOW ( AWAY ) 5000 2 // Mission brief
			GOTO mission_joey2_failed
		ENDIF
 
		IF NOT IS_CHAR_IN_CAR chunky chunkys_car
			GOTO fuckin_run_for_it	
		ENDIF 
 
		IF IS_CAR_UPSIDEDOWN chunkys_car
		AND IS_CAR_STOPPED chunkys_car
			SET_CHAR_OBJ_LEAVE_CAR chunky chunkys_car
			GOTO fuckin_run_for_it
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
ENDWHILE
 
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
SET_CHAR_OBJ_LEAVE_CAR chunky chunkys_car
 
WHILE IS_CHAR_IN_CAR chunky chunkys_car
	WAIT 0
 
		GOSUB controller_modes
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player chunky 160.0 160.0 FALSE
			PRINT_NOW ( AWAY ) 5000 2 // Mission brief
			GOTO mission_joey2_failed
		ENDIF
 
		IF IS_CAR_DEAD chunkys_car
			GOTO mission_joey2_passed
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
ENDWHILE
 
GOTO fuckin_run_for_it
 
 
run_the_other_way:
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 979.1 -720.8
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	GOSUB pickup_and_audio
 
ENDWHILE
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 976.7 -687.0
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	GOSUB pickup_and_audio
 
ENDWHILE
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 943.5 -679.2
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	GOSUB pickup_and_audio
 
ENDWHILE
 
SET_CHAR_OBJ_RUN_TO_COORD chunky 920.3 -681.5
 
WHILE NOT IS_CHAR_OBJECTIVE_PASSED chunky
	WAIT 0
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	GOSUB pickup_and_audio
 
ENDWHILE
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
	IF IS_CAR_DEAD chunkys_car2
		GOTO fuckin_run_for_it
	ELSE
		IF NOT IS_CAR_IN_AREA_2D chunkys_car2 922.7 -673.9 906.6 -698.0 FALSE
		OR NOT IS_CAR_HEALTH_GREATER chunkys_car2 300
			GOTO fuckin_run_for_it
		ENDIF
	ENDIF
 
SET_CHAR_OBJ_ENTER_CAR_AS_DRIVER chunky chunkys_car2
 
	WHILE NOT IS_CHAR_IN_CAR chunky chunkys_car2
		WAIT 0
 
		IF IS_CAR_DEAD chunkys_car2
			GOTO fuckin_run_for_it
		ELSE
			IF NOT IS_CAR_IN_AREA_2D chunkys_car2 922.7 -673.9 906.6 -698.0 FALSE
			OR NOT IS_CAR_HEALTH_GREATER chunkys_car2 300
				GOTO fuckin_run_for_it
			ENDIF
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
	ENDWHILE
 
	IF NOT IS_CAR_DEAD chunkys_car2
		CAR_WANDER_RANDOMLY chunkys_car2
		SET_CAR_DRIVING_STYLE chunkys_car2 2
		SET_CAR_CRUISE_SPEED chunkys_car2 20.0
		//LOCK_CAR_DOORS chunkys_car2 CARLOCK_UNLOCKED
	ENDIF
 
//DISPLAY_ONSCREEN_COUNTER test_car_health_counter //TEST STUFF!!!!!!!!!!!!!
 
	WHILE IS_CAR_HEALTH_GREATER chunkys_car2 300
		WAIT 0 
 
		GOSUB controller_modes
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		IF IS_CAR_DEAD chunkys_car2
			GOTO mission_joey2_passed
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player chunky 160.0 160.0 FALSE
			PRINT_NOW ( AWAY ) 5000 2 // Mission brief
			GOTO mission_joey2_failed
		ENDIF
 
		IF NOT IS_CHAR_IN_CAR chunky chunkys_car2
			GOTO fuckin_run_for_it	
		ENDIF 
 
		IF IS_CAR_UPSIDEDOWN chunkys_car2
		AND IS_CAR_STOPPED chunkys_car2
			SET_CHAR_OBJ_LEAVE_CAR chunky chunkys_car2
			GOTO fuckin_run_for_it
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
 
	ENDWHILE
 
 
	IF IS_CHAR_DEAD chunky
		GOTO mission_joey2_passed
	ENDIF
 
SET_CHAR_OBJ_LEAVE_CAR chunky chunkys_car2
 
WHILE IS_CHAR_IN_CAR chunky chunkys_car2
	WAIT 0
 
		GOSUB controller_modes
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player chunky 160.0 160.0 FALSE
			PRINT_NOW ( AWAY ) 5000 2 // Mission brief
			GOTO mission_joey2_failed
		ENDIF
 
		IF IS_CAR_DEAD chunkys_car2
			GOTO mission_joey2_passed
		ENDIF
 
		IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
		AND been_in_shop_before = 0 
			REMOVE_BLIP blip2_jm2
			been_in_shop_before = 1	
		ENDIF
 
ENDWHILE
 
 
fuckin_run_for_it:
 
IF NOT IS_CHAR_DEAD chunky
	SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS chunky Player
ENDIF
 
//CHANGE_BLIP_DISPLAY blip1_jm2 BOTH
 
WHILE NOT IS_CHAR_DEAD chunky
	WAIT 0
 
		IF IS_CHAR_DEAD chunky
			GOTO mission_joey2_passed
		ENDIF
 
		GOSUB controller_modes
 
		GOSUB pickup_and_audio
 
		IF NOT HAS_PICKUP_BEEN_COLLECTED gun_chunky
			GOSUB Ammu_bloke_audio
		ENDIF
 
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player chunky 160.0 160.0 FALSE
			PRINT_NOW ( AWAY ) 5000 2 // Mission brief
			GOTO mission_joey2_failed
		ENDIF
 
ENDWHILE
 
 
GOTO mission_joey2_passed
 
 
 // Mission joey2 failed
 
mission_joey2_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission joey2 passed
 
mission_joey2_passed:
 
flag_joey_mission2_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	JM2
PLAYER_MADE_PROGRESS 1
START_NEW_SCRIPT joey_mission3_loop
IF out_of_stock_pistol = 0
   	START_NEW_SCRIPT pistol_message
ENDIF
RETURN
 
// mission cleanup
 
mission_cleanup_joey2:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
special_ammu_audio = 0		 
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_TRIAD_A
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_PERENNIAL
UNLOAD_SPECIAL_CHARACTER 2
REMOVE_BLIP blip1_jm2
REMOVE_BLIP blip2_jm2
REMOVE_PICKUP gun_chunky
IF NOT IS_CHAR_DEAD	chunky
	REMOVE_CHAR_ELEGANTLY chunky
ENDIF
MISSION_HAS_FINISHED
RETURN
 
 
 
 
controller_modes:
 
	IF flag_player_had_gun_message = 0
 
		IF IS_PLAYER_IN_AREA_ON_FOOT_3D player 1075.2 -384.8 14.0 1086.2 -403.3 17.0 FALSE
 
			GET_CONTROLLER_MODE controlmode
 
// Control Mode 0
 
			IF controlmode = 0
 
				IF flag_gun_message_jm2 = 0 
					PRINT_HELP ( GUN_1A ) //"Use R2 and L2 to cycle through your weapons."
					timerb = 0
					flag_gun_message_jm2 = 1
				ENDIF
 
				IF flag_gun_message_jm2 = 1
					IF timerb > 10000
						PRINT_HELP ( GUN_2A ) //"Hold R1 to auto-target, press circle to fire!"
						timerb = 0
						flag_gun_message_jm2 = 2
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 2
					IF timerb > 10000
						PRINT_HELP ( GUN_3A ) //"While holding the ~h~R1 button,~w~ press the ~h~L2 button~w~ or the ~h~R2 button to switch target."
						timerb = 0
						flag_gun_message_jm2 = 3
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 3
					IF timerb > 10000
						PRINT_HELP ( GUN_4A ) //"While holding the ~h~R1 button~w~ you can walk or run while remaining locked onto a target."
						timerb = 0
						flag_gun_message_jm2 = 4
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 4
					IF timerb > 10000
						PRINT_HELP ( GUN_5 ) //"You can practice targeting and shooting on these paper targets, when you are finished resume the mission."
						flag_gun_message_jm2 = 5
						flag_player_had_gun_message = 1
					ENDIF
				ENDIF
 
			ENDIF
 
// Control Mode 1
 
			IF controlmode = 1
 
				IF flag_gun_message_jm2 = 0 
					PRINT_HELP ( GUN_1A ) //"Use R2 and L2 to cycle through your weapons."
					timerb = 0
					flag_gun_message_jm2 = 1
				ENDIF
 
				IF flag_gun_message_jm2 = 1
					IF timerb > 10000
						PRINT_HELP ( GUN_2A ) //"Hold R1 to auto-target, press circle to fire!"
						timerb = 0
						flag_gun_message_jm2 = 2
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 2
					IF timerb > 10000
						PRINT_HELP ( GUN_3A ) //"While holding the ~h~R1 button,~w~ press the ~h~L2 button~w~ or the ~h~R2 button to switch target."
						timerb = 0
						flag_gun_message_jm2 = 3
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 3
					IF timerb > 10000
						PRINT_HELP ( GUN_4A ) //"While holding the ~h~R1 button~w~ you can walk or run while remaining locked onto a target."
						timerb = 0
						flag_gun_message_jm2 = 4
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 4
					IF timerb > 10000
						PRINT_HELP ( GUN_5 ) //"You can practice targeting and shooting on these paper targets, when you are finished resume the mission."
						flag_gun_message_jm2 = 5
						flag_player_had_gun_message = 1
					ENDIF
				ENDIF
 
 
			ENDIF
 
// Control Mode 2
 
			IF controlmode = 2
 
				IF flag_gun_message_jm2 = 0 
					PRINT_HELP ( GUN_1A ) //"Use R2 and L2 to cycle through your weapons."
					timerb = 0
					flag_gun_message_jm2 = 1
				ENDIF
 
				IF flag_gun_message_jm2 = 1
					IF timerb > 10000
						PRINT_HELP ( GUN_2C ) //"Hold R1 to auto-target, press circle to fire!"
						timerb = 0
						flag_gun_message_jm2 = 2
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 2
					IF timerb > 10000
						PRINT_HELP ( GUN_3A ) //"While holding the ~h~R1 button,~w~ press the ~h~L2 button~w~ or the ~h~R2 button to switch target."
						timerb = 0
						flag_gun_message_jm2 = 3
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 3
					IF timerb > 10000
						PRINT_HELP ( GUN_4A ) //"While holding the ~h~R1 button~w~ you can walk or run while remaining locked onto a target."
						timerb = 0
						flag_gun_message_jm2 = 4
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 4
					IF timerb > 10000
						PRINT_HELP ( GUN_5 ) //"You can practice targeting and shooting on these paper targets, when you are finished resume the mission."
						flag_gun_message_jm2 = 5
						flag_player_had_gun_message = 1
					ENDIF
				ENDIF
 
			ENDIF
 
// Control Mode 3
 
			IF controlmode = 3
 
				IF flag_gun_message_jm2 = 0 
					PRINT_HELP ( GUN_1A ) //"Use R2 and L2 to cycle through your weapons."
					timerb = 0
					flag_gun_message_jm2 = 1
				ENDIF
 
				IF flag_gun_message_jm2 = 1
					IF timerb > 10000
						PRINT_HELP ( GUN_2D ) //"Hold R1 to auto-target, press circle to fire!"
						timerb = 0
						flag_gun_message_jm2 = 2
					   //	flag_player_had_gun_message = 1
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 1
					IF timerb > 10000
						PRINT_HELP ( GUN_2C ) //"Hold R1 to auto-target, press circle to fire!"
						timerb = 0
						flag_gun_message_jm2 = 2
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 2
					IF timerb > 10000
						PRINT_HELP ( GUN_3B ) //"While holding the ~h~R1 button,~w~ press the ~h~L2 button~w~ or the ~h~R2 button to switch target."
						timerb = 0
						flag_gun_message_jm2 = 3
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 3
					IF timerb > 10000
						PRINT_HELP ( GUN_4B ) //"While holding the ~h~R1 button~w~ you can walk or run while remaining locked onto a target."
						timerb = 0
						flag_gun_message_jm2 = 4
					ENDIF
				ENDIF
 
				IF flag_gun_message_jm2 = 4
					IF timerb > 10000
						PRINT_HELP ( GUN_5 ) //"You can practice targeting and shooting on these paper targets, when you are finished resume the mission."
						flag_gun_message_jm2 = 5
						flag_player_had_gun_message = 1
					ENDIF
				ENDIF
 
			ENDIF
 
		ENDIF
 
	ENDIF
 
 
RETURN
 
 
 
 
Ammu_bloke_audio:
 
 
	IF has_audio_been_activated = 0
 
		IF IS_PLAYER_IN_AREA_3D player 1066.6 -403.5 14.0 1072.8 -394.0 18.0 FALSE 
 
		 	special_ammu_audio = 1
 
			LOAD_MISSION_AUDIO AMMU_B //AMMU_B
 
			IF camera_ammu1 = 1
 
				IF NOT IS_CHAR_DEAD ammu_shop_bloke1
 
					WHILE NOT HAS_MISSION_AUDIO_LOADED
						WAIT 0
 
						IF IS_CHAR_DEAD ammu_shop_bloke1
						OR IS_PLAYER_SHOOTING player
							GOTO clear_audio   
						ENDIF
 
					ENDWHILE
 
					PLAY_MISSION_AUDIO
					PRINT_NOW ( AMMU_B ) 5000 2 // Mission brief
 
					WHILE NOT HAS_MISSION_AUDIO_FINISHED
						WAIT 0
 
						IF IS_CHAR_DEAD ammu_shop_bloke1
						OR IS_PLAYER_SHOOTING player
							GOTO clear_audio   
						ENDIF
 
					ENDWHILE
 
					LOAD_MISSION_AUDIO AMMU_C //AMMU_C
 
					WHILE NOT HAS_MISSION_AUDIO_LOADED
						WAIT 0
 
						IF IS_CHAR_DEAD ammu_shop_bloke1
						OR IS_PLAYER_SHOOTING player
							GOTO clear_audio   
						ENDIF
 
					ENDWHILE
 
					PLAY_MISSION_AUDIO
					PRINT_NOW ( AMMU_C ) 5000 2 // Mission brief
 
					clear_audio:
					has_audio_been_activated = 1
					//CLEAR_MISSION_AUDIO 
					special_ammu_audio = 0
				ELSE
					special_ammu_audio = 0
					CLEAR_MISSION_AUDIO	
				ENDIF
 
			ENDIF
 
		ELSE
			special_ammu_audio = 0
			CLEAR_MISSION_AUDIO
		ENDIF
 
	ENDIF
 
 
RETURN
 
 
 
pickup_and_audio:
 
 
	IF HAS_PICKUP_BEEN_COLLECTED gun_chunky  
	AND been_in_shop_before = 0 
		REMOVE_BLIP blip2_jm2
		been_in_shop_before = 1	
	ENDIF
 
	IF NOT IS_CHAR_DEAD chunky
		IF TIMERB > 2500
			TIMERB = 0
			SET_CHAR_SAY chunky	SOUND_CHUNKY_RUN_SHOUT
		ENDIF
	ENDIF
 
RETURN

joey3

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Joey mission 3****************************************
// ***************************************Van heist*******************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff
 
GOSUB mission_start_joey3
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey3_failed
ENDIF
 
GOSUB mission_cleanup_joey3
 
MISSION_END
 
 
// Variables for mission
 
VAR_INT van_jm3 in_the_locate_joey3
 
VAR_INT blip1_jm3 blip2_jm3 
 
VAR_INT	flag_car_blip_displayed_jm3
 
VAR_INT van_man1_jm3 van_man2_jm3 old_van_health 
 
VAR_INT test_van_health_counter	test_van_health_counter2
 
// ***************************************Mission Start*************************************
 
mission_start_joey3:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
SCRIPT_NAME joey3
WAIT 0
 
in_the_locate_joey3 = 0
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_MODEL cut_obj1 JOEYH
LOAD_SPECIAL_MODEL cut_obj2 PLAYERH
LOAD_SPECIAL_MODEL cut_obj3 TROLL
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED	cut_obj3
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
	WAIT 0
ENDWHILE
 
 
LOAD_CUTSCENE J3_VH
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977 
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ1 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ2 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT CUT_OBJ3 cs_troll
SET_CUTSCENE_ANIM cs_troll TROLL
 
CLEAR_AREA 1191.9 -870.4 15.0 1.0 TRUE
SET_PLAYER_COORDINATES player 1191.9 -870.4 -100.0
 
SET_PLAYER_HEADING player 230.0
 
DO_FADE 1500 FADE_IN
 
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
GET_CUTSCENE_TIME cs_time
 
 
WHILE cs_time < 5515
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_A ) 10000 2 // Mission brief
 
WHILE cs_time < 7894
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_B ) 10000 2 // Mission brief
 
WHILE cs_time < 10381
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_C ) 10000 2 // Mission brief
 
WHILE cs_time < 14589
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_D ) 10000 2 // Mission brief
 
WHILE cs_time < 17518
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_E ) 10000 2 // Mission brief
 
WHILE cs_time < 21627
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM3_F ) 10000 2 // Mission brief
 
WHILE cs_time < 24675
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 27333 
	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
 
SWITCH_RUBBISH ON
CLEAR_CUTSCENE
SET_CAMERA_IN_FRONT_OF_PLAYER
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
UNLOAD_SPECIAL_CHARACTER 1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
LOAD_SPECIAL_CHARACTER 2 S_GUARD
REQUEST_MODEL CAR_SECURICAR
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 2
OR NOT HAS_MODEL_LOADED CAR_SECURICAR 
	WAIT 0
ENDWHILE
 
 
// START OF MISSION
 
CREATE_CAR CAR_SECURICAR 1063.0 -805.0 14.6 van_jm3
LOCK_CAR_DOORS van_jm3 CARLOCK_LOCKOUT_PLAYER_ONLY
SET_CAR_ONLY_DAMAGED_BY_PLAYER van_jm3 TRUE
SET_CAR_PROOFS van_jm3 TRUE TRUE FALSE FALSE TRUE
SET_CAR_CRUISE_SPEED  van_jm3 14.0
SET_CAR_DRIVING_STYLE  van_jm3 0
ADD_BLIP_FOR_CAR van_jm3 blip1_jm3
 
CREATE_CHAR_INSIDE_CAR van_jm3 PEDTYPE_SPECIAL PED_SPECIAL2 van_man1_jm3
SET_CHAR_PERSONALITY van_man1_jm3 PEDSTAT_GEEK_GUY
 
CREATE_CHAR_AS_PASSENGER van_jm3 PEDTYPE_SPECIAL PED_SPECIAL2 0 van_man2_jm3
SET_CHAR_PERSONALITY van_man2_jm3 PEDSTAT_GEEK_GUY
 
GET_CAR_HEALTH van_jm3 test_van_health_counter
DISPLAY_ONSCREEN_COUNTER_WITH_STRING test_van_health_counter COUNTER_DISPLAY_BAR (DAM) //TEST STUFF!!!!!!!!!!!!!
 
GET_CAR_HEALTH van_jm3 test_van_health_counter 
	test_van_health_counter2 = 1000 - test_van_health_counter
 
	IF test_van_health_counter2 > 400
		test_van_health_counter2 = 400
	ENDIF
 
	test_van_health_counter = test_van_health_counter2 / 4
 
 
WHILE IS_CAR_HEALTH_GREATER van_jm3 999
	WAIT 0
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF  
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
	GET_CAR_HEALTH van_jm3 test_van_health_counter 
		test_van_health_counter2 = 1000 - test_van_health_counter
 
	IF test_van_health_counter2 > 400
		test_van_health_counter2 = 400
	ENDIF
 
	test_van_health_counter = test_van_health_counter2 / 4
 
ENDWHILE
 
	IF NOT IS_CAR_DEAD van_jm3
		SET_CAR_DRIVING_STYLE van_jm3 2
		SET_CAR_CRUISE_SPEED van_jm3 20.0
		ALTER_WANTED_LEVEL_NO_DROP Player 1
		SET_CAR_ONLY_DAMAGED_BY_PLAYER van_jm3 FALSE
		GET_CAR_HEALTH van_jm3 old_van_health
	ENDIF
 
WHILE IS_CAR_HEALTH_GREATER van_jm3 750
	WAIT 0
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF  
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
	IF NOT IS_CAR_DEAD van_jm3
		GET_CAR_HEALTH van_jm3 test_van_health_counter
 
		IF test_van_health_counter < old_van_health
			ALTER_WANTED_LEVEL_NO_DROP Player 1
		ENDIF	
 
		old_van_health = test_van_health_counter
 
		test_van_health_counter2 = 1000 - test_van_health_counter
 
		IF test_van_health_counter2 > 400
			test_van_health_counter2 = 400
		ENDIF
 
		test_van_health_counter = test_van_health_counter2 / 4
	ENDIF
 
ENDWHILE
 
WHILE IS_CAR_HEALTH_GREATER van_jm3 600
	WAIT 0
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF  
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
	IF NOT IS_CAR_DEAD van_jm3
		GET_CAR_HEALTH van_jm3 test_van_health_counter
 
		IF test_van_health_counter < old_van_health
			ALTER_WANTED_LEVEL_NO_DROP Player 2
		ENDIF	
 
		old_van_health = test_van_health_counter
 
		test_van_health_counter2 = 1000 - test_van_health_counter
 
		IF test_van_health_counter2 > 400
			test_van_health_counter2 = 400
		ENDIF
 
		test_van_health_counter = test_van_health_counter2 / 4
	ENDIF
 
ENDWHILE
 
 
	IF NOT IS_CAR_DEAD van_jm3
		LOCK_CAR_DOORS van_jm3 CARLOCK_UNLOCKED
		CLEAR_ONSCREEN_COUNTER test_van_health_counter
 
		IF NOT IS_CHAR_DEAD van_man1_jm3
			SET_CHAR_OBJ_LEAVE_CAR van_man1_jm3 van_jm3
		ENDIF
 
		IF NOT IS_CHAR_DEAD van_man2_jm3
			SET_CHAR_OBJ_LEAVE_CAR van_man2_jm3 van_jm3
		ENDIF
	ENDIF
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF
 
WHILE NOT IS_CHAR_IN_CAR van_man1_jm3 van_jm3
OR NOT IS_CHAR_IN_CAR van_man2_jm3 van_jm3 
	WAIT 0
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF 
 
	IF IS_CHAR_DEAD van_man1_jm3
	OR IS_CHAR_DEAD van_man2_jm3
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
ENDWHILE
 
	WAIT 1600
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF
 
	IF NOT IS_CHAR_DEAD van_man1_jm3
	AND NOT IS_CHAR_DEAD van_man2_jm3
		SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS van_man1_jm3 player
		SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS van_man2_jm3 player
		SET_CHAR_SAY van_man2_jm3 SOUND_SECURITY_GUARD_RUN_AWAY_SHOUT
	ENDIF
 
	IF NOT IS_CAR_DEAD van_jm3
		SET_TARGET_CAR_FOR_MISSION_GARAGE Garage_bank van_jm3
	ENDIF
 
	flag_car_blip_displayed_jm3 = TRUE
 
	garage_stop:
 
	TIMERB = 0
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D van_jm3 1440.7 -805.6 10.9 1449.8 -782.1 15.9 FALSE
OR NOT IS_PLAYER_IN_CAR player van_jm3
	WAIT 0
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF
 
	IF IS_PLAYER_IN_CAR player van_jm3
		IF flag_car_blip_displayed_jm3 = TRUE
			ADD_BLIP_FOR_COORD 1445.8 -796.7 -100.0 blip2_jm3
			CHANGE_BLIP_DISPLAY blip2_jm3 BLIP_ONLY
			REMOVE_BLIP blip1_jm3
			PRINT_NOW ( jm3_1 ) 5000 1
		flag_car_blip_displayed_jm3 = FALSE
		ENDIF
	ENDIF
 
	IF NOT IS_PLAYER_IN_CAR player van_jm3									
		IF flag_car_blip_displayed_jm3 = FALSE
		ADD_BLIP_FOR_CAR van_jm3 blip1_jm3
		REMOVE_BLIP blip2_jm3
		PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the Van!"
		flag_car_blip_displayed_jm3 = TRUE
		ENDIF
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
	IF NOT IS_CHAR_DEAD	van_man2_jm3
		IF TIMERB > 4000
			TIMERB = 0
			SET_CHAR_SAY van_man2_jm3 SOUND_SECURITY_GUARD_RUN_AWAY_SHOUT
		ENDIF
	ENDIF
 
	IF in_the_locate_joey3 = 0
		IF LOCATE_PLAYER_IN_CAR_3D player 1445.0 -811.5 11.8 4.0 6.0 4.0 TRUE
			CLEAR_WANTED_LEVEL player
			in_the_locate_joey3 = 1
		ENDIF
	ENDIF
 
	IF in_the_locate_joey3 = 1
		IF NOT IS_CAR_IN_AREA_3D van_jm3 1440.7 -805.6 10.9 1449.8 -782.1 15.9 FALSE
		AND NOT LOCATE_PLAYER_IN_CAR_3D player 1445.0 -811.5 11.8 4.0 6.0 4.0 FALSE
			in_the_locate_joey3 = 0
		ENDIF
	ENDIF
 
ENDWHILE
 
 
	PRINT_NOW ( OUT_VEH ) 5000 2 //Get out of the van
 
WHILE NOT IS_CAR_IN_MISSION_GARAGE Garage_bank
 
	IF IS_CAR_DEAD van_jm3
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey3_failed
	ENDIF
 
	IF NOT IS_CAR_IN_AREA_3D van_jm3 1440.7 -805.6 10.9 1449.8 -782.1 15.9 FALSE
		GOTO garage_stop
	ENDIF 
 
	IF IS_CAR_UPSIDEDOWN van_jm3
	AND IS_CAR_STOPPED van_jm3
		GOTO mission_joey3_failed
	ENDIF
 
	WAIT 0
ENDWHILE
 
 
REMOVE_BLIP blip2_jm3
 
 
 
GOTO mission_joey3_passed
 
 
 // Mission joey3 failed
 
mission_joey3_failed:
PRINT_BIG ( m_fail ) 2000 1
RETURN
 
 
 
// mission joey3 passed
 
mission_joey3_passed:
 
flag_joey_mission3_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
REGISTER_MISSION_PASSED	JM3
PLAYER_MADE_PROGRESS 1
CHANGE_GARAGE_TYPE_WITH_CAR_MODEL Garage_bank GARAGE_COLLECTSPECIFICCARS CAR_SECURICAR
START_NEW_SCRIPT joey_mission4_loop
START_NEW_SCRIPT diablo_phone_start
START_NEW_SCRIPT van_heist_garage_pager
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_joey3:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
REMOVE_BLIP blip1_jm3
REMOVE_BLIP blip2_jm3
UNLOAD_SPECIAL_CHARACTER 2
SET_TARGET_CAR_FOR_MISSION_GARAGE Garage_bank -1
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_SECURICAR
CLEAR_ONSCREEN_COUNTER test_van_health_counter
MISSION_HAS_FINISHED
RETURN

joey4

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// **************************************Joey Mission 4***************************************
// ***************************************pick up Toni****************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
 
// Mission start stuff
 
GOSUB mission_start_joey4
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey4_failed
ENDIF
 
GOSUB mission_cleanup_joey4
 
MISSION_END
 
 
// Variables for mission
 
VAR_INT blip1_jm4 blip2_jm4 blip3_jm4 flag_car_blip_displayed_jm4 triads_ojective_passed 	
 
VAR_INT ojective_triad1_done_before ojective_triad2_done_before
 
VAR_INT Toni_abuse1_done_before	tonis_car_created_before played_tune_before
 
VAR_INT flag_displayed_wanted_message_jm4 flag_displayed_horn_message_jm4
 
VAR_INT tonis_ride is_char1_dead_jm4 is_char2_dead_jm4 is_char3_dead_jm4 is_char4_dead_jm4
 
VAR_INT triad1_jm4 triad2_jm4 triad3_jm4 triad4_jm4 tonis_audio_all_finished
 
VAR_FLOAT door1_position_jm4 door2_position_jm4 
 
// ***************************************Mission Start*************************************
 
 
mission_start_joey4:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
SCRIPT_NAME joey4
WAIT 0
 
IF tonis_car_created_before = 1
	GOSUB delete_tonis_car
ENDIF
 
flag_displayed_wanted_message_jm4 = 0
flag_displayed_horn_message_jm4 = 0
Toni_abuse1_done_before = 0
ojective_triad1_done_before	= 0
ojective_triad2_done_before	= 0
triads_ojective_passed = 0
tonis_audio_all_finished = 0
played_tune_before = 0
 
SET_CAR_DENSITY_MULTIPLIER 0.0 //TURN ALL THE CARS OFF
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_CHARACTER 2 tony
LOAD_SPECIAL_MODEL cut_obj1 JOEDOOR
LOAD_SPECIAL_MODEL cut_obj2 JOEYH
LOAD_SPECIAL_MODEL cut_obj3 PLAYERH
LOAD_SPECIAL_MODEL cut_obj4 TONYH
REQUEST_MODEL CAR_MAFIA
REQUEST_MODEL CAR_IDAHO
REQUEST_MODEL CAR_STALLION
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_MODEL_LOADED CAR_MAFIA 
OR NOT HAS_MODEL_LOADED CAR_IDAHO
OR NOT HAS_MODEL_LOADED CAR_STALLION
	WAIT 0
ENDWHILE
 
CREATE_CAR CAR_MAFIA 1189.72 -864.28 14.1 tonis_ride
tonis_car_created_before = 1
SET_CAR_HEADING tonis_ride -142.0
SET_RADIO_CHANNEL 1 -1
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_SPECIAL_CHARACTER_LOADED 2	
	WAIT 0
 
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED cut_obj3
OR NOT HAS_MODEL_LOADED cut_obj4
	WAIT 0
 
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
	WAIT 0
ENDWHILE
 
//LOAD_SCENE 1190.07 -869.86 13.97
 
LOAD_CUTSCENE J4_ETH
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977
 
CREATE_CAR CAR_IDAHO 1182.5 -857.0 14.1 cut_car2_lm3
SET_CAR_HEADING cut_car2_lm3 291.2
 
CREATE_CAR CAR_STALLION 1192.9 -860.8 14.0 cut_car3_lm3
SET_CAR_HEADING cut_car3_lm3 150.0
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL2 cs_tony
SET_CUTSCENE_ANIM cs_tony tony
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ2 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_tony CUT_OBJ4 cs_tonyhead
SET_CUTSCENE_HEAD_ANIM cs_tonyhead tony
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ3 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT cut_obj1 cs_joedoor
SET_CUTSCENE_ANIM cs_joedoor JOEDOOR
 
CLEAR_AREA 1195.0 -870.3 15.0 10.0 TRUE
 
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 FALSE
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 FALSE
 
//MOVE GARAGE UP
GET_OBJECT_COORDINATES joeys_garage_door2 joeydoor2_X joeydoor2_Y joeydoor2_Z
GET_OBJECT_COORDINATES joeys_garage_door3 joeydoor3_X joeydoor3_Y joeydoor3_Z
 
joeydoor2_Z = joeydoor2_Z + 3.0
joeydoor3_Z = joeydoor3_Z + 3.0
 
	WHILE NOT SLIDE_OBJECT joeys_garage_door2 joeydoor2_X joeydoor2_Y joeydoor2_Z 0.1 0.1 100.0 FALSE
	OR NOT SLIDE_OBJECT joeys_garage_door3 joeydoor3_X joeydoor3_Y joeydoor3_Z 0.1 0.1 100.0 FALSE
		WAIT 0								  
 
			IF IS_CAR_DEAD tonis_ride
				PRINT_NOW ( JM4_8 ) 5000 1
				GOTO mission_joey4_failed	
			ENDIF
 
			IF IS_CAR_UPSIDEDOWN tonis_ride
			AND IS_CAR_STOPPED tonis_ride
				PRINT_NOW ( WRECKED ) 5000 1
				GOTO mission_joey4_failed
			ENDIF
 
	ENDWHILE
 
DO_FADE 1800 FADE_IN
 
//SWITCH_WORLD_PROCESSING OFF
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
 
GET_CUTSCENE_TIME cs_time
 
 
WHILE cs_time < 1
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_A ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 4000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_B ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 6180
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_C ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 10230
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_D ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 13040
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_E ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 15110
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_F ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 18080
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM4_G ) 10000 1 //"Go to X, wait for Toni"
 
WHILE cs_time < 23511
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 23833
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
//DO_FADE 1000 FADE_OUT
 
//WHILE GET_FADING_STATUS
//	WAIT 0
//ENDWHILE
 
WHILE NOT HAS_CUTSCENE_FINISHED
	WAIT 0
 
ENDWHILE
 
//SWITCH_WORLD_PROCESSING ON
SWITCH_RUBBISH ON
CLEAR_PRINTS
CLEAR_CUTSCENE
 
IF NOT IS_CAR_DEAD tonis_ride
	CREATE_CHAR_AS_PASSENGER tonis_ride PEDTYPE_SPECIAL PED_SPECIAL2 0 toni
	CLEAR_CHAR_THREAT_SEARCH toni
	SET_CHAR_CANT_BE_DRAGGED_OUT toni TRUE
	ADD_ARMOUR_TO_CHAR toni 100
	WARP_PLAYER_INTO_CAR Player tonis_ride
ENDIF
 
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door1 TRUE
SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE 1192.23 -867.252 14.124 6.0 joey_door2 TRUE
 
CLEAR_AREA 1198.5 -871.4 15.0 10.0 TRUE
//SET_FIXED_CAMERA_POSITION 1206.0 -864.6 15.4 0.0 0.0 0.0
//POINT_CAMERA_AT_PLAYER player FIXED JUMP_CUT
SET_FIXED_CAMERA_POSITION 1200.831 -869.373 15.001 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1199.887 -869.701 15.025 JUMP_CUT
 
WAIT 0
SWITCH_WIDESCREEN ON
SET_POLICE_IGNORE_PLAYER Player ON
SET_PLAYER_CONTROL Player OFF
 
//WAIT 500
 
//DO_FADE 1000 FADE_IN
 
UNLOAD_SPECIAL_CHARACTER 1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ4
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_IDAHO
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_STALLION
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
DELETE_CAR cut_car2_lm3
DELETE_CAR cut_car3_lm3
 
	LOAD_MISSION_AUDIO J4T_1
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
	PLAY_MISSION_AUDIO
	PRINT_NOW ( JM4_10 ) 5000 1 //"Go to X, wait for Toni"
 
//CAR DRIVING OUT OF GARAGE CUT SCENE
 
IF NOT IS_CAR_DEAD tonis_ride						 
	CAR_GOTO_COORDINATES_ACCURATE tonis_ride 1198.5 -871.4 -100.0
	SET_CAR_CRUISE_SPEED tonis_ride 2.0
	SET_CAR_DRIVING_STYLE tonis_ride 3
ENDIF
 
IF NOT IS_CHAR_DEAD toni
	CHAR_LOOK_AT_PLAYER_ALWAYS toni player
	PLAYER_LOOK_AT_CHAR_ALWAYS player toni
	//SET_ANIM_GROUP_FOR_CHAR toni ANIM_OLDFAT_PED
ENDIF
 
WHILE NOT LOCATE_CAR_2D tonis_ride 1198.5 -871.4 2.0 2.0 FALSE
	WAIT 0
 
	IF IS_CAR_DEAD tonis_ride
		GOTO mission_joey4_failed
	ENDIF
 
	IF tonis_audio_all_finished = 0
 
		WHILE NOT HAS_MISSION_AUDIO_FINISHED
			WAIT 0
 
			IF IS_CAR_DEAD tonis_ride
			OR IS_CHAR_DEAD toni
				PRINT_NOW ( JM4_8 ) 5000 1 
				GOTO mission_joey4_failed	
			ENDIF
 
		ENDWHILE
 
		LOAD_MISSION_AUDIO J4T_2
 
		WHILE NOT HAS_MISSION_AUDIO_LOADED
			WAIT 0
 
			IF IS_CAR_DEAD tonis_ride
			OR IS_CHAR_DEAD toni
				PRINT_NOW ( JM4_8 ) 5000 1 
				GOTO mission_joey4_failed	
			ENDIF
 
		ENDWHILE
 
		PLAY_MISSION_AUDIO
		PRINT_NOW ( JM4_11 ) 5000 1 //"Go to X, wait for Toni"
 
		WHILE NOT HAS_MISSION_AUDIO_FINISHED
			WAIT 0
 
			IF IS_CAR_DEAD tonis_ride
			OR IS_CHAR_DEAD toni
				PRINT_NOW ( JM4_8 ) 5000 1 
				GOTO mission_joey4_failed	
			ENDIF
 
		ENDWHILE
 
		LOAD_MISSION_AUDIO J4T_3
 
		tonis_audio_all_finished = 1
	ENDIF
 
 
ENDWHILE
 
CLEAR_PRINTS
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
	ENDWHILE
 
	PLAY_MISSION_AUDIO
	PRINT_NOW ( JM4_12 ) 5000 1 //"Go to X, wait for Toni"
 
GET_OBJECT_COORDINATES joeys_garage_door2 joeydoor2_X joeydoor2_Y joeydoor2_Z
GET_OBJECT_COORDINATES joeys_garage_door3 joeydoor3_X joeydoor3_Y joeydoor3_Z
 
joeydoor2_Z = joeydoor2_Z - 3.0
joeydoor3_Z = joeydoor3_Z - 3.0
 
WHILE NOT SLIDE_OBJECT joeys_garage_door2 joeydoor2_X joeydoor2_Y joeydoor2_Z 0.1 0.1 0.1 FALSE
OR NOT SLIDE_OBJECT joeys_garage_door3 joeydoor3_X joeydoor3_Y joeydoor3_Z 0.1 0.1 0.1 FALSE
	WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni 
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed	
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
ENDWHILE 
 
	WHILE NOT HAS_MISSION_AUDIO_FINISHED
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
	ENDWHILE
 
	LOAD_MISSION_AUDIO J4T_4
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
	ENDWHILE
 
	PLAY_MISSION_AUDIO
	PRINT_NOW ( JM4_13 ) 5000 1 //"Go to X, wait for Toni"
 
	WHILE NOT HAS_MISSION_AUDIO_FINISHED
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
	ENDWHILE
 
IF NOT IS_CHAR_DEAD toni
	STOP_CHAR_LOOKING toni
	STOP_PLAYER_LOOKING Player
ENDIF
 
CLEAR_PRINTS
 
SWITCH_WIDESCREEN OFF
SET_PLAYER_CONTROL Player On
SET_CAR_STATUS tonis_ride STATUS_PLAYER
SET_POLICE_IGNORE_PLAYER Player Off
RESTORE_CAMERA
SET_CAR_DENSITY_MULTIPLIER 1.0 // TURN ALL THE CARS BACK ON
SWITCH_CAR_GENERATOR gen_car12 0
 
	REQUEST_MODEL PED_GANG_TRIAD_A
	REQUEST_MODEL PED_GANG_TRIAD_B
	LOAD_MISSION_AUDIO J4_A
 
	WHILE NOT HAS_MODEL_LOADED PED_GANG_TRIAD_A
	OR NOT HAS_MODEL_LOADED PED_GANG_TRIAD_B
	OR NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
 
SWITCH_PED_ROADS_OFF 824.9 -633.8 13.0 845.3 -693.8 18.0 
SWITCH_ROADS_OFF 824.9 -633.8 13.0 845.3 -693.8 18.0
CLEAR_AREA 843.4 -663.8 15.0 10.0 TRUE
 
ADD_BLIP_FOR_COORD 843.0 -660.0 -100.0 blip1_jm4
CHANGE_BLIP_DISPLAY blip1_jm4 BLIP_ONLY
 
 
	CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 850.0 -663.0 14.7 triad1_jm4
	CLEAR_CHAR_THREAT_SEARCH triad1_jm4
	SET_CHAR_PROOFS triad1_jm4 TRUE TRUE TRUE TRUE TRUE
 
	CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_B 850.0 -664.7 14.7 triad2_jm4
	CLEAR_CHAR_THREAT_SEARCH triad2_jm4
	SET_CHAR_PROOFS triad2_jm4 TRUE TRUE TRUE TRUE TRUE
 
	TURN_CHAR_TO_FACE_CHAR triad1_jm4 triad2_jm4
	TURN_CHAR_TO_FACE_CHAR triad2_jm4 triad1_jm4
 
REMOVE_BLIP blip1_jm4
flag_car_blip_displayed_jm4 = TRUE
blob_flag = 1
 
	IF IS_CAR_DEAD tonis_ride
		PRINT_NOW ( JM4_8 ) 5000 1
		GOTO mission_joey4_failed
	ENDIF
 
	WHILE NOT IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player 839.2 -667.4 14.0 842.1 -673.9 17.0 blob_flag
	OR IS_WANTED_LEVEL_GREATER Player 0
	OR NOT IS_PLAYER_IN_CAR Player tonis_ride    	
 
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF NOT IS_PLAYER_IN_CAR player tonis_ride
			IF flag_car_blip_displayed_jm4 = FALSE
			ADD_BLIP_FOR_CAR tonis_ride blip2_jm4
			blob_flag = 0
			REMOVE_BLIP blip1_jm4
			PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
			flag_car_blip_displayed_jm4 = TRUE
			ENDIF
		ENDIF
 
		IF IS_PLAYER_IN_CAR player tonis_ride
			IF flag_car_blip_displayed_jm4 = TRUE
				ADD_BLIP_FOR_COORD 843.0 -660.0 -100.0 blip1_jm4
				blob_flag = 1
				REMOVE_BLIP blip2_jm4
			flag_car_blip_displayed_jm4 = FALSE
			ENDIF
		ENDIF
 
		IF NOT IS_CAR_HEALTH_GREATER tonis_ride 900
		AND	Toni_abuse1_done_before = 0
			PRINT_NOW ( JM4_6 ) 5000 1 //"Watch the fuckin CAR!"
			PLAY_MISSION_AUDIO
			Toni_abuse1_done_before = 1
		ENDIF	
 
		IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player 839.2 -667.4 14.0 842.1 -673.9 17.0 FALSE
 
			IF IS_WANTED_LEVEL_GREATER player 0
				IF flag_displayed_wanted_message_jm4 = 0
					PRINT_NOW ( WANTED1 ) 3000 1
					flag_displayed_wanted_message_jm4 = 1
				ENDIF
 
			ENDIF
		ELSE
			IF NOT IS_PLAYER_IN_AREA_3D player 839.2 -667.4 14.0 842.1 -673.9 17.0 FALSE
				flag_displayed_wanted_message_jm4 = 0
			ENDIF
		ENDIF
 
	ENDWHILE
 
REMOVE_BLIP blip1_jm4
SET_POLICE_IGNORE_PLAYER Player ON
SET_PLAYER_CONTROL Player Off
SWITCH_WIDESCREEN ON
SET_FIXED_CAMERA_POSITION 825.604 -680.602 16.567 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 826.336 -679.921 16.539 JUMP_CUT
 
	LOAD_MISSION_AUDIO J4_B
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
 
//TONI LANDRETTE CUT_SCENE
IF NOT IS_CHAR_DEAD	triad1_jm4
AND NOT IS_CHAR_DEAD triad2_jm4
	SET_CHARS_CHATTING triad1_jm4 triad2_jm4 999999
ENDIF
 
IF NOT IS_CHAR_DEAD	toni
	SET_CHAR_PROOFS toni TRUE TRUE TRUE TRUE TRUE
ENDIF
 
PLAY_MISSION_AUDIO
PRINT_NOW ( JM4_2 ) 5000 1 //wait here
 
CLEAR_AREA 843.4 -663.8 15.0 10.0 TRUE
 
WAIT 4000
 
	IF IS_CAR_DEAD tonis_ride
	OR IS_CHAR_DEAD toni
		PRINT_NOW ( JM4_8 ) 5000 1 
		GOTO mission_joey4_failed	
	ENDIF
 
GIVE_WEAPON_TO_CHAR toni WEAPONTYPE_BASEBALLBAT 0
SET_CHAR_OBJ_LEAVE_CAR toni tonis_ride
 
	WHILE IS_CHAR_IN_CAR toni tonis_ride
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
	ENDWHILE
 
//SET_FIXED_CAMERA_POSITION 840.0 -672.4 17.0 0.0 0.0 0.0
//SET_FIXED_CAMERA_POSITION 836.632 -670.922 17.843 0.0 0.0 0.0
//POINT_CAMERA_AT_CHAR toni FIXED INTERPOLATION
 
SET_FIXED_CAMERA_POSITION 841.312 -669.063 16.536 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 842.117 -668.501 16.343 JUMP_CUT
 
//TONI WALKS TO DOORS
 
	IF IS_CAR_DEAD tonis_ride
	OR IS_CHAR_DEAD toni
		PRINT_NOW ( JM4_8 ) 5000 1 
		GOTO mission_joey4_failed	
	ENDIF
 
TURN_CHAR_TO_FACE_COORD toni 843.9 -663.7 15.1
 
TIMERB = 0
 
SET_CHAR_OBJ_GOTO_COORD_ON_FOOT toni 843.9 -663.7
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED toni
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF TIMERB > 10000
			IF NOT IS_CHAR_DEAD	toni
				SET_CHAR_COORDINATES toni 843.9 -663.7 13.9
			ENDIF
		ENDIF
 
	ENDWHILE
 
 
//OPEN DOORS
 
	WHILE NOT ROTATE_OBJECT laundrete_door1 90.0 10.0 FALSE
	OR NOT ROTATE_OBJECT laundrete_door2 90.0 10.0 FALSE
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
	ENDWHILE
 
//TONI WALKS IN
 
	IF IS_CAR_DEAD tonis_ride
	OR IS_CHAR_DEAD toni 
		PRINT_NOW ( JM4_8 ) 5000 1
		GOTO mission_joey4_failed	
	ENDIF
 
TIMERB = 0
 
SET_CHAR_OBJ_GOTO_COORD_ON_FOOT toni 848.1 -663.4
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED toni
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF TIMERB > 10000
			IF NOT IS_CHAR_DEAD	toni
				SET_CHAR_COORDINATES toni 848.1 -663.4 13.9
			ENDIF
		ENDIF
 
	ENDWHILE
 
SET_CHAR_OBJ_WAIT_ON_FOOT toni
 
IF NOT IS_CHAR_DEAD triad1_jm4
AND NOT IS_CHAR_DEAD triad2_jm4
	SET_CHARS_CHATTING triad1_jm4 triad2_jm4 0
ENDIF
 
WAIT 0
 
	IF NOT IS_CHAR_DEAD triad1_jm4
	AND NOT IS_CHAR_DEAD triad2_jm4
	AND NOT IS_CHAR_DEAD toni
		TURN_CHAR_TO_FACE_CHAR triad1_jm4 toni
		TURN_CHAR_TO_FACE_CHAR triad2_jm4 toni
		CHAR_LOOK_AT_CHAR_ALWAYS triad1_jm4 toni
		CHAR_LOOK_AT_CHAR_ALWAYS triad2_jm4	toni
	ENDIF
 
WAIT 5000
 
ADD_ONE_OFF_SOUND 845.0 -663.0 14.0 sound_test_1 //Need Sound event
 
GET_OBJECT_HEADING laundrete_door1 door1_position_jm4
GET_OBJECT_HEADING laundrete_door2 door2_position_jm4
 
 
	IF IS_CHAR_DEAD toni 
		PRINT_NOW ( JM4_8 ) 5000 1
		GOTO mission_joey4_failed	
	ENDIF
 
TURN_CHAR_TO_FACE_COORD toni 843.9 -663.7 15.1
 
	IF NOT IS_CHAR_DEAD triad1_jm4
	OR NOT IS_CHAR_DEAD triad2_jm4
		GIVE_WEAPON_TO_CHAR triad1_jm4 WEAPONTYPE_PISTOL 100
		GIVE_WEAPON_TO_CHAR triad2_jm4 WEAPONTYPE_PISTOL 100
	ENDIF
 
SET_CHAR_RUNNING toni TRUE
 
	IF NOT IS_CHAR_DEAD triad1_jm4
	OR NOT IS_CHAR_DEAD triad2_jm4
		SET_CHAR_STAY_IN_SAME_PLACE triad1_jm4 TRUE
		SET_CHAR_STAY_IN_SAME_PLACE triad2_jm4 TRUE
		SET_CHAR_OBJ_KILL_CHAR_ON_FOOT triad1_jm4 toni
		SET_CHAR_OBJ_KILL_CHAR_ON_FOOT triad2_jm4 toni
	ENDIF
 
//TONI RUNS OUT
 
CLEAR_AREA 843.4 -663.8 15.0 10.0 TRUE
 
TIMERB = 0
 
IF NOT IS_CHAR_DEAD triad1_jm4
AND NOT IS_CHAR_DEAD triad2_jm4
	STOP_CHAR_LOOKING triad1_jm4
	STOP_CHAR_LOOKING triad2_jm4 
ENDIF
 
SET_CHAR_OBJ_RUN_TO_COORD toni 843.9 -663.7
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED toni
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF TIMERB > 10000
			IF NOT IS_CHAR_DEAD	toni
				SET_CHAR_COORDINATES toni 843.9 -663.7 13.9
			ENDIF
		ENDIF
 
	ENDWHILE
 
SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER toni tonis_ride
SET_FIXED_CAMERA_POSITION 836.029 -677.868 15.840 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 836.713 -677.156 15.680 JUMP_CUT
 
WAIT 1500
 
	IF NOT IS_CHAR_DEAD triad1_jm4
	AND NOT IS_CHAR_DEAD triad2_jm4
		SET_CHAR_STAY_IN_SAME_PLACE triad1_jm4 FALSE
		SET_CHAR_STAY_IN_SAME_PLACE triad2_jm4 FALSE
		SET_CHAR_OBJ_RUN_TO_COORD triad1_jm4 842.0 -663.8
		SET_CHAR_OBJ_RUN_TO_COORD triad2_jm4 843.5 -663.8
	ENDIF
 
//TRIADS RUN OUT
 
	WHILE NOT triads_ojective_passed = 2
		WAIT 0
 
			IF IS_CHAR_DEAD toni
				PRINT_NOW ( JM4_8 ) 5000 1
				GOTO mission_joey4_failed
			ENDIF
 
			IF IS_CAR_DEAD tonis_ride
				GOTO mission_joey4_failed
			ENDIF
 
			IF IS_CHAR_DEAD triad1_jm4
			AND ojective_triad1_done_before = 0
				triads_ojective_passed ++
				ojective_triad1_done_before = 1
			ENDIF
 
			IF IS_CHAR_DEAD triad2_jm4
			AND ojective_triad2_done_before = 0
				triads_ojective_passed ++
				ojective_triad2_done_before = 1
			ENDIF
 
			IF IS_CHAR_OBJECTIVE_PASSED triad1_jm4
			AND ojective_triad1_done_before = 0
				SET_CHAR_OBJ_DESTROY_CAR triad1_jm4 tonis_ride
				triads_ojective_passed ++
				ojective_triad1_done_before = 1
			ENDIF
 
			IF IS_CHAR_OBJECTIVE_PASSED triad2_jm4
			AND ojective_triad2_done_before = 0
				SET_CHAR_OBJ_DESTROY_CAR triad2_jm4 tonis_ride	
				triads_ojective_passed ++
				ojective_triad2_done_before = 1
			ENDIF
 
	ENDWHILE
 
 
	WHILE NOT IS_CHAR_IN_CAR toni tonis_ride
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
	ENDWHILE
 
	CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_A 843.1 -689.0 13.9 triad3_jm4
	GIVE_WEAPON_TO_CHAR triad3_jm4 WEAPONTYPE_PISTOL 100
	SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT triad3_jm4 Player
	SET_CHAR_THREAT_SEARCH triad3_jm4 THREAT_PLAYER1
 
	CREATE_CHAR PEDTYPE_GANG_TRIAD PED_GANG_TRIAD_B 844.3 -634.8 13.9 triad4_jm4
	GIVE_WEAPON_TO_CHAR triad4_jm4 WEAPONTYPE_PISTOL 100
	SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT triad4_jm4 Player
	SET_CHAR_THREAT_SEARCH triad4_jm4 THREAT_PLAYER1
 
	IF NOT IS_CHAR_DEAD	toni
		SET_CHAR_PROOFS toni FALSE FALSE FALSE FALSE FALSE
	ENDIF
 
	IF NOT IS_CHAR_DEAD triad1_jm4
	AND NOT IS_CHAR_DEAD triad2_jm4
		SET_CHAR_PROOFS triad1_jm4 FALSE FALSE FALSE FALSE FALSE
		SET_CHAR_PROOFS triad2_jm4 FALSE FALSE FALSE FALSE FALSE
	ENDIF
 
SET_PLAYER_CONTROL Player On
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA
 
	LOAD_MISSION_AUDIO J4_C
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
PLAY_MISSION_AUDIO
PRINT_NOW ( JM4_3 ) 4000 1 //"GO GO GO!"
SET_POLICE_IGNORE_PLAYER Player OFF
 
ADD_BLIP_FOR_COORD 1216.8 -327.6 -100.0 blip3_jm4
CHANGE_BLIP_DISPLAY blip3_jm4 BLIP_ONLY
 
	// CLOSE DOORS
	WHILE NOT ROTATE_OBJECT laundrete_door1 0.0 10.0 FALSE
	OR NOT ROTATE_OBJECT laundrete_door2 180.0 10.0	FALSE
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
	ENDWHILE
 
is_char1_dead_jm4 = 0
is_char2_dead_jm4 = 0
is_char3_dead_jm4 = 0
is_char4_dead_jm4 = 0
flag_car_blip_displayed_jm4 = TRUE
 
REMOVE_BLIP blip3_jm4
 
// waiting for the player to get to Toni's
 
IF NOT IS_CHAR_DEAD	triad1_jm4
	SET_CHAR_THREAT_SEARCH triad1_jm4 THREAT_PLAYER1
ENDIF
 
IF NOT IS_CHAR_DEAD	triad2_jm4
	SET_CHAR_THREAT_SEARCH triad2_jm4 THREAT_PLAYER1
ENDIF
 
CLEAR_AREA 1216.7 -328.1 26.0 6.0 TRUE
 
flag_displayed_wanted_message_jm4 = 0
 
blob_flag = 1
 
	WHILE NOT IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player 1215.0 -326.9 25.0 1220.2 -330.5 27.0 blob_flag
	OR IS_WANTED_LEVEL_GREATER Player 0
	OR NOT IS_PLAYER_IN_CAR	player tonis_ride
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CAR_DEAD tonis_ride
			GOTO mission_joey4_failed
		ENDIF
 
		IF NOT IS_PLAYER_IN_CAR player tonis_ride
			IF flag_car_blip_displayed_jm4 = FALSE
				ADD_BLIP_FOR_CAR tonis_ride blip2_jm4
				REMOVE_BLIP blip3_jm4
				PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
				blob_flag = 0
				flag_car_blip_displayed_jm4 = TRUE
			ENDIF
		ENDIF
 
		IF IS_PLAYER_IN_CAR player tonis_ride
			IF flag_car_blip_displayed_jm4 = TRUE
				ADD_BLIP_FOR_COORD 1216.8 -327.6 -100.0 blip3_jm4
				REMOVE_BLIP blip2_jm4
				blob_flag = 1
			flag_car_blip_displayed_jm4 = FALSE
			ENDIF
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
		IF IS_CHAR_DEAD triad1_jm4
		AND is_char1_dead_jm4 = 0
			is_char1_dead_jm4 = 1
		ENDIF
 
		IF IS_CHAR_DEAD triad2_jm4
		AND is_char2_dead_jm4 = 0
			is_char2_dead_jm4 = 1		
		ENDIF
 
		IF IS_CHAR_DEAD triad3_jm4
		AND is_char3_dead_jm4 = 0
			is_char3_dead_jm4 = 1
		ENDIF
 
		IF IS_CHAR_DEAD triad4_jm4
		AND is_char4_dead_jm4 = 0
			is_char4_dead_jm4 = 1		
		ENDIF
 
		IF is_char1_dead_jm4 = 1
		AND is_char2_dead_jm4 = 1
		AND is_char3_dead_jm4 = 1
		AND is_char4_dead_jm4 = 1
		AND played_tune_before = 0
			ADD_SCORE player 2000
			GET_PLAYER_COORDINATES Player player_X player_Y player_Z
			ADD_ONE_OFF_SOUND player_X player_Y player_Z SOUND_PART_MISSION_COMPLETE
			played_tune_before = 1
		ENDIF
 
		IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player 1215.0 -326.9 25.0 1220.2 -330.5 27.0 FALSE
 
			IF IS_WANTED_LEVEL_GREATER player 0
				IF flag_displayed_wanted_message_jm4 = 0
					PRINT_NOW ( WANTED1 ) 3000 1
					flag_displayed_wanted_message_jm4 = 1
				ENDIF
			ELSE
 
			ENDIF
		ELSE
			IF NOT IS_PLAYER_IN_AREA_3D player 1215.0 -326.9 25.0 1220.2 -330.5 27.0 FALSE
				flag_displayed_wanted_message_jm4 = 0
			ENDIF
		ENDIF
 
	ENDWHILE
 
REMOVE_BLIP blip3_jm4
 
CLEAR_AREA 1216.5 -326.8 26.0 6.0 TRUE
CLEAR_AREA 1219.6 -319.2 27.7 2.0 TRUE
SET_PLAYER_CONTROL Player Off
SET_POLICE_IGNORE_PLAYER Player ON
SWITCH_WIDESCREEN ON
 
SET_FIXED_CAMERA_POSITION 1224.119 -333.413 26.529 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1223.382 -332.738 26.568 JUMP_CUT
 
IF NOT IS_CHAR_DEAD	toni
	SET_CURRENT_CHAR_WEAPON toni WEAPONTYPE_UNARMED
	CHAR_LOOK_AT_PLAYER_ALWAYS toni player
	PLAYER_LOOK_AT_CHAR_ALWAYS player toni
ENDIF
 
REMOVE_BLIP blip2_jm4
 
//SAMPLE 1***************************************************
LOAD_MISSION_AUDIO J4_D
 
WHILE NOT HAS_MISSION_AUDIO_LOADED
	WAIT 0
ENDWHILE
 
PLAY_MISSION_AUDIO
PRINT_NOW ( JM4_4 ) 4000 1 //"come back for job"
 
WHILE NOT HAS_MISSION_AUDIO_FINISHED
	WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
ENDWHILE
 
//SAMPLE 2***************************************************
LOAD_MISSION_AUDIO J4_E
 
WHILE NOT HAS_MISSION_AUDIO_LOADED
	WAIT 0
ENDWHILE
 
PLAY_MISSION_AUDIO
PRINT_NOW ( JM4_5 ) 5000 1 //"come back for job"
 
WHILE NOT HAS_MISSION_AUDIO_FINISHED
	WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
ENDWHILE
 
//SAMPLE 3***************************************************
LOAD_MISSION_AUDIO J4_F
 
WHILE NOT HAS_MISSION_AUDIO_LOADED
	WAIT 0
ENDWHILE
 
PLAY_MISSION_AUDIO
 
WHILE NOT HAS_MISSION_AUDIO_FINISHED
	WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
ENDWHILE
 
 
	IF IS_CAR_DEAD tonis_ride
	OR IS_CHAR_DEAD toni
		PRINT_NOW ( JM4_8 ) 5000 1 
		GOTO mission_joey4_failed	
	ENDIF
 
	IF NOT IS_CHAR_DEAD toni
		SET_CHAR_RUNNING toni FALSE
		SET_CHAR_OBJ_LEAVE_CAR toni tonis_ride
		STOP_CHAR_LOOKING toni
		STOP_PLAYER_LOOKING Player
	ENDIF
 
	WHILE IS_CHAR_IN_CAR toni tonis_ride
		WAIT 0
 
		IF IS_CAR_DEAD tonis_ride
		OR IS_CHAR_DEAD toni 
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed	
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN tonis_ride
		AND IS_CAR_STOPPED tonis_ride
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey4_failed
		ENDIF
 
	ENDWHILE
 
	IF IS_CHAR_DEAD toni 
		PRINT_NOW ( JM4_8 ) 5000 1
		GOTO mission_joey4_failed	
	ENDIF
 
TIMERB = 0
CLEAR_AREA 1219.4 -324.4 26.1 2.0 TRUE
SET_CHAR_OBJ_GOTO_COORD_ON_FOOT toni 1219.4 -324.4
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED toni
		WAIT 0
 
		IF IS_CHAR_DEAD toni
			PRINT_NOW ( JM4_8 ) 5000 1 
			GOTO mission_joey4_failed	
		ENDIF
 
		IF TIMERB > 10000
			IF NOT IS_CHAR_DEAD	toni
				SET_CHAR_COORDINATES toni 1219.4 -324.4 -100.0
			ENDIF
		ENDIF
 
	ENDWHILE
 
	IF IS_CHAR_DEAD toni
		PRINT_NOW ( JM4_8 ) 5000 1 
		GOTO mission_joey4_failed	
	ENDIF
 
TIMERB = 0
CLEAR_AREA 1219.5 -315.4 29.9 2.0 TRUE
SET_CHAR_OBJ_GOTO_COORD_ON_FOOT toni 1219.5 -318.6
 
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) 3000 7000 1 //"Mission Passed!"
CLEAR_WANTED_LEVEL player
ADD_SCORE player 3000
 
	WHILE NOT IS_CHAR_OBJECTIVE_PASSED toni
		WAIT 0
 
		IF IS_CHAR_DEAD toni 
			PRINT_NOW ( JM4_8 ) 5000 1
			GOTO mission_joey4_failed	
		ENDIF
 
		IF TIMERB > 10000
			IF NOT IS_CHAR_DEAD	toni
				SET_CHAR_COORDINATES toni 1219.5 -318.6 28.4
			ENDIF
		ENDIF
 
	ENDWHILE
 
SWITCH_WIDESCREEN OFF
SET_PLAYER_CONTROL Player On
SET_POLICE_IGNORE_PLAYER Player OFF
RESTORE_CAMERA_JUMPCUT
DELETE_CHAR toni
 
 
GOTO mission_joey4_passed
 
 
 
// Mission Joey4 failed
 
mission_joey4_failed:
//SWITCH_WIDESCREEN OFF
//SET_PLAYER_CONTROL Player On
//RESTORE_CAMERA_JUMPCUT
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission Joey4 passed
 
mission_joey4_passed:
 
flag_joey_mission4_passed = 1
//PLAY_MISSION_PASSED_TUNE 1
//PRINT_WITH_NUMBER_BIG ( M_PASS ) 3000 5000 1 //"Mission Passed!"
//CLEAR_WANTED_LEVEL player
//ADD_SCORE player 3000
REGISTER_MISSION_PASSED JM4
PLAYER_MADE_PROGRESS 1
ADD_SPRITE_BLIP_FOR_CONTACT_POINT 1219.6 -321.0 26.4 RADAR_SPRITE_TONY toni_contact_blip
REMOVE_PICKUP SHOP_UZI 
CREATE_PICKUP WEAPON_UZI PICKUP_IN_SHOP 1070.5 -400.8 15.2 SHOP_UZI2
START_NEW_SCRIPT toni_mission1_loop
START_NEW_SCRIPT joey_mission5_loop 
START_NEW_SCRIPT uzi_message
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_joey4:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
REMOVE_BLIP blip1_jm4
REMOVE_BLIP blip2_jm4
REMOVE_BLIP blip3_jm4
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_MAFIA
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_TRIAD_A
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_TRIAD_B
SWITCH_PED_ROADS_ON 824.9 -633.8 13.0 845.3 -693.8 18.0 
SWITCH_ROADS_ON 824.9 -633.8 13.0 845.3 -693.8 18.0 
UNLOAD_SPECIAL_CHARACTER 2
SWITCH_CAR_GENERATOR gen_car12 101
REMOVE_CHAR_ELEGANTLY toni
MISSION_HAS_FINISHED
RETURN
 
delete_tonis_car:
 
	DELETE_CAR tonis_ride
 
RETURN

joey5

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// *************************************Joey mission 5****************************************
// *********************************Dead Skunk in the Trunk***********************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
// Mission start stuff
 
GOSUB mission_start_joey5
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey5_failed
ENDIF
 
GOSUB mission_cleanup_joey5
 
MISSION_END
 
 
// Variables for mission
 
 
VAR_INT deadman_car blip1_j5 blip2_j5
 
VAR_INT lipsbrother1_car lipsbrother2_car is_lipsbrother1_car_dead is_lipsbrother2_car_dead
 
VAR_INT lipsbrother1 lipsbrother2 skunk_message_played_before
 
VAR_INT flag_car_blip_displayed_j5 flag_car_crushed_joey5
 
VAR_INT on_new_objective_joey5_1 on_new_objective_joey5_2 
 
VAR_INT flag_dont_do_car_check_joey5 flag_leave_car_message_joey5 flag_car_in_area_joey5
 
// ***************************************Mission Start*************************************
 
mission_start_joey5:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
SCRIPT_NAME joey5
WAIT 0
 
skunk_message_played_before = 0
flag_dont_do_car_check_joey5 = 0
flag_leave_car_message_joey5 = 0
flag_car_in_area_joey5 = 0
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_MODEL cut_obj1 JOEYH
LOAD_SPECIAL_MODEL cut_obj2 PLAYERH
LOAD_SPECIAL_MODEL cut_obj3 TROLL
REQUEST_MODEL CAR_IDAHO
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
//LOAD_SCENE 1190.07 -869.86 13.97
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED cut_obj3
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
OR NOT HAS_MODEL_LOADED CAR_IDAHO
	WAIT 0
ENDWHILE
 
 
LOAD_CUTSCENE J5_DST
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977
 
CREATE_CAR CAR_IDAHO 1182.5 -857.0 14.1 cut_car2_lm3
SET_CAR_HEADING cut_car2_lm3 291.2
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ1 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ2 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT CUT_OBJ3 cs_troll
SET_CUTSCENE_ANIM cs_troll TROLL
 
CLEAR_AREA 1191.9 -870.4 15.0 1.0 TRUE
SET_PLAYER_COORDINATES player 1191.9 -870.4 -100.0
 
SET_PLAYER_HEADING player 230.0
 
DO_FADE 1500 FADE_IN
 
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
GET_CUTSCENE_TIME cs_time
 
 
WHILE cs_time < 1250
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM5_A ) 10000 2 // Mission brief
 
WHILE cs_time < 5658
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM5_B ) 10000 2 // Mission brief
 
WHILE cs_time < 8419
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM5_C ) 10000 2 // Mission brief
 
WHILE cs_time < 12522
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM5_D ) 10000 2 // Mission brief
 
WHILE cs_time < 16368
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM5_E ) 10000 2 // Mission brief
 
WHILE cs_time < 18855
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
CLEAR_PRINTS
 
WHILE cs_time < 20000
	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
 
SWITCH_RUBBISH ON
CLEAR_CUTSCENE
SET_CAMERA_IN_FRONT_OF_PLAYER
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
UNLOAD_SPECIAL_CHARACTER 1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_IDAHO
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
DELETE_CAR cut_car2_lm3
 
on_new_objective_joey5_1 = 0
on_new_objective_joey5_2 = 0
is_lipsbrother1_car_dead = 0
is_lipsbrother2_car_dead = 0
flag_car_blip_displayed_j5 = TRUE
flag_car_crushed_joey5 = 0
 
REQUEST_MODEL PED_GANG_MAFIA_B
REQUEST_MODEL CAR_CORPSE
REQUEST_MODEL CAR_SENTINEL
 
	WHILE NOT HAS_MODEL_LOADED PED_GANG_MAFIA_B
	OR NOT HAS_MODEL_LOADED CAR_CORPSE
	OR NOT HAS_MODEL_LOADED CAR_SENTINEL
		WAIT 0
	ENDWHILE	
 
// START OF MISSION
 
CREATE_CAR CAR_CORPSE 867.2 -992.8 -100.0 deadman_car
ADD_BLIP_FOR_CAR deadman_car blip1_j5
 
CREATE_CAR CAR_SENTINEL 892.0 -992.3 4.6 lipsbrother1_car
SET_CAR_HEADING lipsbrother1_car 90.0
SET_CAR_STRONG lipsbrother1_car	TRUE
CREATE_CHAR_INSIDE_CAR lipsbrother1_car PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_B lipsbrother1
GIVE_WEAPON_TO_CHAR lipsbrother1 WEAPONTYPE_PISTOL 60
CAR_SET_IDLE  lipsbrother1_car
LOCK_CAR_DOORS lipsbrother1_car CARLOCK_LOCKED
SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother1_car TRUE
 
CREATE_CAR CAR_SENTINEL 800.0 -961.9 -100.0 lipsbrother2_car
SET_CAR_HEADING lipsbrother2_car 241.0
SET_CAR_STRONG lipsbrother2_car	TRUE
CREATE_CHAR_INSIDE_CAR lipsbrother2_car PEDTYPE_GANG_MAFIA PED_GANG_MAFIA_B lipsbrother2
GIVE_WEAPON_TO_CHAR lipsbrother2 WEAPONTYPE_PISTOL 60
CAR_SET_IDLE  lipsbrother2_car
LOCK_CAR_DOORS lipsbrother2_car CARLOCK_LOCKED
SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother2_car TRUE
 
	WHILE NOT IS_PLAYER_IN_CAR player deadman_car
		WAIT 0
 
		IF IS_CAR_DEAD deadman_car
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey5_failed
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN deadman_car
		AND IS_CAR_STOPPED deadman_car
			PRINT_NOW ( WRECKED ) 5000 1
   			GOTO mission_joey5_failed
   		ENDIF
 
		IF IS_CHAR_DEAD lipsbrother1
		AND is_lipsbrother1_car_dead = 0
			ADD_SCORE player 5000 
			is_lipsbrother1_car_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD lipsbrother2
		AND is_lipsbrother2_car_dead = 0
			ADD_SCORE player 5000 
			is_lipsbrother2_car_dead = 1
		ENDIF
 
		IF NOT IS_CAR_DEAD lipsbrother1_car
			IF NOT IS_CAR_HEALTH_GREATER lipsbrother1_car 999
				PRINT_NOW ( JM5_2 ) 5000 1 // Gosh! it's the Forelis! 
				GOTO kill_the_player
			ENDIF
		ENDIF
 
		IF NOT IS_CAR_DEAD lipsbrother2_car
			IF NOT IS_CAR_HEALTH_GREATER lipsbrother2_car 999
				PRINT_NOW ( JM5_2 ) 5000 1 // Gosh! it's the Forelis! 
				GOTO kill_the_player
			ENDIF
		ENDIF
 
	ENDWHILE 
 
SET_POLICE_IGNORE_PLAYER Player ON
SET_PLAYER_CONTROL Player OFF
SWITCH_WIDESCREEN ON
 
SET_FIXED_CAMERA_POSITION 863.389 -988.698 4.350 0.0 0.0 0.0 
POINT_CAMERA_AT_POINT 864.217 -989.236 4.507 JUMP_CUT
SET_PED_DENSITY_MULTIPLIER 0.0
 
PRINT_NOW ( JM5_2 ) 5000 1 // Gosh! it's the Forelis! 
 
WAIT 1500
 
	IF NOT IS_CHAR_DEAD lipsbrother1
		IF NOT IS_CAR_DEAD lipsbrother1_car
			SET_CAR_MISSION lipsbrother1_car MISSION_RAMPLAYER_FARAWAY
			SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother1_car FALSE
			SET_CAR_CRUISE_SPEED lipsbrother1_car 40.0
			SET_CAR_DRIVING_STYLE lipsbrother1_car 2
			SET_CHAR_THREAT_SEARCH lipsbrother1 THREAT_PLAYER1
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD lipsbrother2
		IF NOT IS_CAR_DEAD lipsbrother2_car
			SET_CAR_MISSION lipsbrother2_car MISSION_BLOCKPLAYER_FARAWAY
			SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother2_car FALSE
			SET_CAR_CRUISE_SPEED lipsbrother2_car 40.0
			SET_CAR_DRIVING_STYLE lipsbrother2_car 2
			SET_CHAR_THREAT_SEARCH lipsbrother2 THREAT_PLAYER1
		ENDIF
	ENDIF
 
WAIT 1500
 
SET_PED_DENSITY_MULTIPLIER 1.0
SET_POLICE_IGNORE_PLAYER Player OFF
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA_JUMPCUT
 
kill_the_player:
 
		IF NOT IS_CHAR_DEAD lipsbrother1
			IF NOT IS_CAR_DEAD lipsbrother1_car
				SET_CAR_MISSION lipsbrother1_car MISSION_RAMPLAYER_FARAWAY
				SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother1_car FALSE
				SET_CAR_CRUISE_SPEED lipsbrother1_car 40.0
				SET_CAR_DRIVING_STYLE lipsbrother1_car 2
				SET_CHAR_THREAT_SEARCH lipsbrother1 THREAT_PLAYER1
			ENDIF
		ENDIF
 
		IF NOT IS_CHAR_DEAD lipsbrother2
			IF NOT IS_CAR_DEAD lipsbrother2_car
				SET_CAR_MISSION lipsbrother2_car MISSION_RAMPLAYER_FARAWAY
				SET_CAR_ONLY_DAMAGED_BY_PLAYER lipsbrother2_car FALSE
				SET_CAR_CRUISE_SPEED lipsbrother2_car 40.0
				SET_CAR_DRIVING_STYLE lipsbrother2_car 2
				SET_CHAR_THREAT_SEARCH lipsbrother2 THREAT_PLAYER1
			ENDIF
		ENDIF
 
ADD_BLIP_FOR_COORD 1139.0 54.5.0 -100.0 blip2_j5
 
//	char_dead1 = 0
//	char_dead2 = 0
 
REMOVE_BLIP blip2_j5
 
blob_flag = 1
 
car_not_quite_under_crane:
	WAIT 0
 
	IF IS_CAR_DEAD deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ENDIF
 
WHILE NOT IS_CAR_STOPPED_IN_AREA_3D deadman_car 1135.8 55.5 -1.0 1149.8 46.3 30.0 blob_flag
	WAIT 0
 
	GOSUB skunk_car_check
 
	IF IS_CAR_DEAD deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ELSE
 
		IF IS_CAR_IN_AREA_3D deadman_car 1135.8 55.5 -1.0 1149.8 46.3 30.0 FALSE
			flag_dont_do_car_check_joey5 = 1
 
			IF flag_leave_car_message_joey5 = 0
				PRINT_NOW ( OUT_VEH ) 4000 1 //"Get out of the car!"
				flag_leave_car_message_joey5 = 1
			ENDIF
 
		ELSE
			flag_leave_car_message_joey5 = 0
			flag_dont_do_car_check_joey5 = 0
		ENDIF
 
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN deadman_car
	AND IS_CAR_STOPPED deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ENDIF
 
	IF flag_dont_do_car_check_joey5 = 0
		IF NOT IS_CAR_DEAD deadman_car
			IF IS_PLAYER_IN_CAR player deadman_car
				IF flag_car_blip_displayed_j5 = TRUE
					ADD_BLIP_FOR_COORD 1139.0 54.5.0 -100.0 blip2_j5
					CHANGE_BLIP_DISPLAY blip2_j5 BLIP_ONLY
					REMOVE_BLIP blip1_j5
					flag_car_blip_displayed_j5 = FALSE
					blob_flag = 1
				ENDIF
			ENDIF
 
			IF NOT IS_PLAYER_IN_CAR player deadman_car
				IF flag_car_blip_displayed_j5 = FALSE
					ADD_BLIP_FOR_CAR deadman_car blip1_j5
					REMOVE_BLIP blip2_j5
					PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
					flag_car_blip_displayed_j5 = TRUE
					blob_flag = 0
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
	IF flag_player_had_crusher_help_hm5 = 0
 
		IF LOCATE_PLAYER_ANY_MEANS_2D player 1140.3 50.1 20.0 20.0 FALSE
			IF IS_PLAYER_IN_CAR player deadman_car
				PRINT_HELP ( CRUSH ) //"To crush the car..."
				flag_player_had_crusher_help_hm5 = 1
			ENDIF
		ENDIF
 
	ENDIF
 
	IF IS_PLAYER_IN_CAR player deadman_car
	AND skunk_message_played_before = 0
		PRINT_NOW ( JM5_1 ) 4000 1 // Take it to the crusher
		skunk_message_played_before = 1
	ENDIF
 
ENDWHILE
 
 
	IF IS_CAR_DEAD deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ENDIF
 
	blob_flag = 1
 
 
WHILE NOT IS_CRANE_LIFTING_CAR 1120.0 46.0 deadman_car
	WAIT 0
 
	GOSUB skunk_car_check
 
	IF IS_CAR_DEAD deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ENDIF
 
	IF IS_CAR_UPSIDEDOWN deadman_car
	AND IS_CAR_STOPPED deadman_car
		PRINT_NOW ( WRECKED ) 5000 1
		GOTO mission_joey5_failed
	ENDIF
 
	IF IS_CAR_STOPPED_IN_AREA_3D deadman_car 1135.8 55.5 -1.0 1149.8 46.3 20.0 blob_flag
		flag_car_in_area_joey5 = 1
	ELSE
		flag_car_in_area_joey5 = 0
	ENDIF
 
	IF flag_car_in_area_joey5 = 0
		IF NOT IS_CAR_DEAD deadman_car
			IF IS_PLAYER_IN_CAR player deadman_car
				IF flag_car_blip_displayed_j5 = TRUE
					ADD_BLIP_FOR_COORD 1139.0 54.5.0 -100.0 blip2_j5
					CHANGE_BLIP_DISPLAY blip2_j5 BLIP_ONLY
					REMOVE_BLIP blip1_j5
					flag_car_blip_displayed_j5 = FALSE
					blob_flag = 1
				ENDIF
			ENDIF
 
			IF NOT IS_PLAYER_IN_CAR player deadman_car
				IF flag_car_blip_displayed_j5 = FALSE
					ADD_BLIP_FOR_CAR deadman_car blip1_j5
					REMOVE_BLIP blip2_j5
					PRINT_NOW ( IN_VEH ) 5000 1 //"Get back in the car!"
					flag_car_blip_displayed_j5 = TRUE
					blob_flag = 0
				ENDIF
			ENDIF
		ENDIF
	ENDIF
 
ENDWHILE
 
REMOVE_BLIP blip1_j5
REMOVE_BLIP blip2_j5
CLEAR_PRINTS
 
WHILE NOT IS_CAR_CRUSHED deadman_car
 
		GOSUB skunk_car_check
 
		IF IS_CAR_DEAD deadman_car
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey5_failed
		ENDIF
 
		IF IS_CAR_CRUSHED deadman_car
			GOTO mission_joey5_passed	
		ENDIF
 
		IF IS_CAR_UPSIDEDOWN deadman_car
		AND IS_CAR_STOPPED deadman_car
			PRINT_NOW ( WRECKED ) 5000 1
			GOTO mission_joey5_failed
		ENDIF
 
	 	WAIT 0
ENDWHILE
 
 
GOTO mission_joey5_passed
 
 
 // Mission joey5 failed
 
mission_joey5_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission joey5 passed
 
mission_joey5_passed:
 
flag_joey_mission5_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	JM5
PLAYER_MADE_PROGRESS 1
START_NEW_SCRIPT joey_mission6_loop
RETURN
 
 
 
// mission cleanup
 
mission_cleanup_joey5:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
REMOVE_BLIP blip1_j5
REMOVE_BLIP blip2_j5
MARK_MODEL_AS_NO_LONGER_NEEDED PED_GANG_MAFIA_B
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_SENTINEL
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_CORPSE
IF NOT IS_CAR_DEAD lipsbrother1_car
	LOCK_CAR_DOORS lipsbrother1_car CARLOCK_UNLOCKED 
ENDIF
IF NOT IS_CAR_DEAD lipsbrother2_car
	LOCK_CAR_DOORS lipsbrother2_car CARLOCK_UNLOCKED 
ENDIF 
MISSION_HAS_FINISHED
RETURN
 
// *********************************************************
 
skunk_car_check:
 
	IF IS_CHAR_DEAD lipsbrother1
	AND is_lipsbrother1_car_dead = 0
		ADD_SCORE player 5000 
		is_lipsbrother1_car_dead = 1
	ENDIF
 
	IF IS_CHAR_DEAD lipsbrother2
	AND is_lipsbrother2_car_dead = 0
		ADD_SCORE player 5000 
		is_lipsbrother2_car_dead = 1
	ENDIF
 
	IF NOT IS_CAR_DEAD lipsbrother1_car
 
		IF IS_CAR_UPSIDEDOWN lipsbrother1_car
		AND IS_CAR_STOPPED lipsbrother1_car
		AND on_new_objective_joey5_1 = 0
			IF NOT IS_CHAR_DEAD	lipsbrother1
				LOCK_CAR_DOORS lipsbrother1_car CARLOCK_UNLOCKED
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT lipsbrother1 Player
			ENDIF
			on_new_objective_joey5_1 = 1
		ENDIF
 
		IF IS_CAR_IN_AREA_2D lipsbrother1_car 1122.7 2.9 1183.8 111.9 FALSE
		AND on_new_objective_joey5_1 = 0
			IF NOT IS_CHAR_DEAD	lipsbrother1
				LOCK_CAR_DOORS lipsbrother1_car CARLOCK_UNLOCKED
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT lipsbrother1 Player
			ENDIF
			on_new_objective_joey5_1 = 1
		ENDIF
 
	ENDIF
 
	IF NOT IS_CAR_DEAD lipsbrother2_car
 
		IF IS_CAR_UPSIDEDOWN lipsbrother2_car
		AND IS_CAR_STOPPED lipsbrother2_car
		AND on_new_objective_joey5_2 = 0
			IF NOT IS_CHAR_DEAD	lipsbrother2
				LOCK_CAR_DOORS lipsbrother2_car CARLOCK_UNLOCKED
				SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT lipsbrother2 Player
			ENDIF
			on_new_objective_joey5_2 = 1
		ENDIF
 
		IF NOT IS_CAR_DEAD lipsbrother2_car
			IF IS_CAR_IN_AREA_2D lipsbrother2_car 1122.7 2.9 1183.8 111.9 FALSE
			AND on_new_objective_joey5_1 = 0
				IF NOT IS_CHAR_DEAD	lipsbrother2
					LOCK_CAR_DOORS lipsbrother2_car CARLOCK_UNLOCKED
					SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT lipsbrother2 Player
				ENDIF
				on_new_objective_joey5_1 = 1
			ENDIF
		ENDIF
 
	ENDIF
 
RETURN

joey6

MISSION_START
// *******************************************************************************************
// *******************************************************************************************
// **************************************Joey Mission 6***************************************
// ****************************************Bank Job*******************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
 
 
// Mission start stuff
 
GOSUB mission_start_joey6
 
IF HAS_DEATHARREST_BEEN_EXECUTED
	GOSUB mission_joey6_failed
ENDIF
 
GOSUB mission_cleanup_joey6
 
MISSION_END
 
 
// Variables for mission
 
VAR_INT thug1 thug2 thug3 thugs_score joey_alarm_loop  flag_not_enough_seats
 
VAR_INT blip1_jm6 blip2_jm6 blip3_jm6 thug1_blip thug2_blip thug3_blip	
 
VAR_INT any_car_jm6 maxpassengers sound_already_created_before
 
VAR_INT flag_displayed_horn_message_jm6	flag_displayed_wanted_message_jm6
 
VAR_INT thug1_is_dead thug2_is_dead thug3_is_dead blip_for_thug_added1 blip_for_thug_added2 blip_for_thug_added3
 
VAR_INT objective_count objective_count_done_before1 objective_count_done_before2 objective_count_done_before3
 
VAR_FLOAT bankdoor_X bankdoor_Y bankdoor_Z bankdoor2_X bankdoor2_Y bankdoor2_Z
 
// ***************************************Mission Start*************************************
 
 
mission_start_joey6:
 
REGISTER_MISSION_GIVEN
flag_player_on_mission = 1
flag_player_on_joey_mission = 1
SCRIPT_NAME joey6
WAIT 0
 
 
LOAD_SPECIAL_CHARACTER 1 joey
LOAD_SPECIAL_MODEL cut_obj1 JOEYH
LOAD_SPECIAL_MODEL cut_obj2 PLAYERH
LOAD_SPECIAL_MODEL cut_obj3 TROLL
REQUEST_MODEL CAR_STALLION
REQUEST_MODEL jogarageext
REQUEST_MODEL jogarageint
 
LOAD_ALL_MODELS_NOW
 
//LOAD_SCENE 1190.07 -869.86 13.97
 
LOAD_ALL_MODELS_NOW
 
WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 1
OR NOT HAS_MODEL_LOADED cut_obj1
OR NOT HAS_MODEL_LOADED cut_obj2
OR NOT HAS_MODEL_LOADED cut_obj3
	WAIT 0
ENDWHILE
 
WHILE NOT HAS_MODEL_LOADED jogarageext 
OR NOT HAS_MODEL_LOADED jogarageint
OR NOT HAS_MODEL_LOADED CAR_STALLION
	WAIT 0
ENDWHILE
 
LOAD_CUTSCENE J6_TBJ
SET_CUTSCENE_OFFSET 1190.079 -869.861 13.977
 
CREATE_CAR CAR_STALLION 1192.9 -860.8 14.0 cut_car3_lm3
SET_CAR_HEADING cut_car3_lm3 150.0
 
CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
SET_CUTSCENE_ANIM cs_player player
 
CREATE_CUTSCENE_OBJECT PED_SPECIAL1 cs_joey
SET_CUTSCENE_ANIM cs_joey joey
 
CREATE_CUTSCENE_HEAD cs_joey CUT_OBJ1 cs_joeyhead
SET_CUTSCENE_HEAD_ANIM cs_joeyhead joey
 
CREATE_CUTSCENE_HEAD cs_player CUT_OBJ2 cs_playerhead
SET_CUTSCENE_HEAD_ANIM cs_playerhead player
 
CREATE_CUTSCENE_OBJECT CUT_OBJ3 cs_troll
SET_CUTSCENE_ANIM cs_troll TROLL
 
CLEAR_AREA 1191.9 -870.4 15.0 1.0 TRUE
SET_PLAYER_COORDINATES player 1191.9 -870.4 -100.0
 
SET_PLAYER_HEADING player 230.0
 
DO_FADE 1500 FADE_IN
 
SWITCH_RUBBISH OFF
SWITCH_STREAMING ON
START_CUTSCENE
 
// Displays cutscene text
 
GET_CUTSCENE_TIME cs_time
 
WHILE cs_time < 4434
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM6_A ) 10000 2 // Mission brief
 
WHILE cs_time < 6704
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM6_B ) 10000 2 // Mission brief
 
WHILE cs_time < 12000
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM6_C ) 10000 2 // Mission brief
 
WHILE cs_time < 14274
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM6_D ) 10000 2 // Mission brief
 
WHILE cs_time < 17302
	WAIT 0
	GET_CUTSCENE_TIME cs_time
ENDWHILE
 
PRINT_NOW ( JM6_E ) 10000 2 // Mission brief
 
WHILE cs_time < 21000
	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
 
SWITCH_RUBBISH ON
CLEAR_CUTSCENE
SET_CAMERA_IN_FRONT_OF_PLAYER
 
WAIT 500
 
DO_FADE 1500 FADE_IN
 
UNLOAD_SPECIAL_CHARACTER 1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ2
MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ3
MARK_MODEL_AS_NO_LONGER_NEEDED CAR_STALLION
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageext 
MARK_MODEL_AS_NO_LONGER_NEEDED jogarageint
 
DELETE_CAR cut_car3_lm3
 
thugs_score	= 0
sound_already_created_before = 0
flag_not_enough_seats = 0
 
LOAD_SPECIAL_CHARACTER 2 robber
 
	WHILE NOT HAS_SPECIAL_CHARACTER_LOADED 2
		WAIT 0
	ENDWHILE
 
 
 
// START OF MISSION
 
ADD_BLIP_FOR_COORD 1086.0 -227.0 -100.0 blip1_jm6
CHANGE_BLIP_DISPLAY blip1_jm6 BLIP_ONLY
 
flag_displayed_horn_message_jm6 = 0
flag_displayed_wanted_message_jm6 = 0
 
thug1_is_dead = 0
thug2_is_dead = 0
thug3_is_dead = 0
blip_for_thug_added1 = 0
blip_for_thug_added2 = 0
blip_for_thug_added3 = 0
 
//PICK UP THE THUGS
 
pick_up_thugs:
WAIT 0
 
WHILE NOT IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D player 1089.9 -223.9 1084.5 -228.5 TRUE
OR NOT IS_PLAYER_PRESSING_HORN player
OR IS_WANTED_LEVEL_GREATER Player 0    	
	WAIT 0
 
	IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D player 1089.9 -223.9 1084.5 -228.5 FALSE
 
		IF IS_WANTED_LEVEL_GREATER player 0
			IF flag_not_enough_seats = 0
				PRINT_NOW ( WANTED1 ) 5000 1
			ENDIF
		ELSE
			IF flag_not_enough_seats = 0
				PRINT_NOW ( HORN ) 5000 1
			ENDIF
		ENDIF
	ELSE
		flag_not_enough_seats = 0
	ENDIF
 
	IF NOT IS_PLAYER_IN_AREA_IN_CAR_2D player 1089.9 -223.9 1084.5 -228.5 FALSE
		CLEAR_THIS_PRINT ( WANTED1 )
		CLEAR_THIS_PRINT ( HORN )
	ENDIF
 
	IF IS_PLAYER_IN_AREA_ON_FOOT_2D player 1089.9 -223.9 1084.5 -228.5 FALSE
		PRINT_NOW ( JM6_5 ) 5000 1 //"We need a getaway vehicle"
	ELSE
		CLEAR_THIS_PRINT ( JM6_5 )
	ENDIF
 
	GET_TIME_OF_DAY hours minutes
	IF hours >= 17
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
ENDWHILE  								
 
	STORE_CAR_PLAYER_IS_IN player any_car_jm6
 
	GET_MAXIMUM_NUMBER_OF_PASSENGERS any_car_jm6 maxpassengers
 
	CLEAR_THIS_PRINT ( WANTED1 )
	CLEAR_THIS_PRINT ( HORN )
 
	IF NOT maxpassengers > 2	//	GSW - Changed this from a WHILE
		PRINT_NOW ( NODOORS ) 5000 1 //Car not big enough
		flag_not_enough_seats = 1	
		GOTO pick_up_thugs
	ENDIF
 
	IF IS_PLAYER_IN_MODEL Player CAR_COACH
	OR IS_PLAYER_IN_MODEL Player CAR_BUS
		PRINT_NOW ( JM6_6 ) 5000 1 //Go and get a vehicle less conspicuous
		flag_not_enough_seats = 1		
		GOTO pick_up_thugs
	ENDIF
 
//PICK UP THUGS CUT_SCENE**************************************************************************************
 
CLEAR_AREA 1087.7 -229.2 8.0 6.0 TRUE
 
IF NOT IS_CAR_DEAD any_car_jm6
	LOCK_CAR_DOORS any_car_jm6 CARLOCK_LOCKED_PLAYER_INSIDE
ENDIF
 
WAIT 500
 
SET_PLAYER_CONTROL Player OFF
SWITCH_WIDESCREEN ON
SET_POLICE_IGNORE_PLAYER Player ON
SET_EVERYONE_IGNORE_PLAYER Player ON
 
IF NOT IS_CAR_DEAD any_car_jm6
	LOCK_CAR_DOORS any_car_jm6 CARLOCK_UNLOCKED
ENDIF
 
	REMOVE_BLIP blip1_jm6
 
	CREATE_CHAR PEDTYPE_SPECIAL PED_SPECIAL2 1086.5 -238.3 9.0 thug1
	TURN_CHAR_TO_FACE_PLAYER thug1 Player
	CHAR_SET_IDLE thug1
 
	CREATE_CHAR PEDTYPE_SPECIAL PED_SPECIAL2 1088.4 -237.9 9.0 thug2
	TURN_CHAR_TO_FACE_PLAYER thug2 Player
	CHAR_SET_IDLE thug2
 
	CREATE_CHAR PEDTYPE_SPECIAL PED_SPECIAL2 1090.4 -238.0 9.0 thug3
	TURN_CHAR_TO_FACE_PLAYER thug3 Player
	CHAR_SET_IDLE thug3
 
	GIVE_WEAPON_TO_CHAR thug1 WEAPONTYPE_PISTOL 100
	GIVE_WEAPON_TO_CHAR thug2 WEAPONTYPE_SHOTGUN 50
	GIVE_WEAPON_TO_CHAR thug3 WEAPONTYPE_UZI 100
 
SET_FIXED_CAMERA_POSITION 1078.773 -232.474 12.190 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1079.691 -232.132 11.990 JUMP_CUT
 
	//APPLY_BRAKES_TO_PLAYERS_CAR Player On
 
	SET_CHAR_PERSONALITY thug1 PEDSTAT_TOUGH_GUY
	SET_CHAR_PERSONALITY thug2 PEDSTAT_TOUGH_GUY
	SET_CHAR_PERSONALITY thug3 PEDSTAT_TOUGH_GUY
 
	SET_CHAR_THREAT_SEARCH thug1 THREAT_COP
	SET_CHAR_THREAT_SEARCH thug2 THREAT_COP
	SET_CHAR_THREAT_SEARCH thug3 THREAT_COP
 
WAIT 1000
 
WHILE NOT SLIDE_OBJECT Bank_job_door 1087.523 -233.801 13.5 0.0 0.0 0.07 FALSE
	WAIT 0
 
	GET_TIME_OF_DAY hours minutes
	IF hours >= 17
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
	IF IS_CHAR_DEAD thug1
	OR IS_CHAR_DEAD thug2
	OR IS_CHAR_DEAD thug3
		PRINT_NOW ( JM6_7 ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
ENDWHILE
 
IF NOT IS_CHAR_DEAD thug1
	SET_PLAYER_AS_LEADER thug1 player
	SET_CHAR_RUNNING thug1 TRUE
	WAIT 800
ENDIF
 
IF NOT IS_CHAR_DEAD thug2
	SET_PLAYER_AS_LEADER thug2 player
	SET_CHAR_RUNNING thug2 TRUE
	WAIT 800
ENDIF
 
IF NOT IS_CHAR_DEAD thug3
	SET_PLAYER_AS_LEADER thug3 player
	SET_CHAR_RUNNING thug3 TRUE
	//WAIT 400
ENDIF
 
 
IF NOT IS_CAR_DEAD any_car_jm6
AND NOT IS_CHAR_DEAD thug1
AND NOT IS_CHAR_DEAD thug2
AND NOT IS_CHAR_DEAD thug3
 
TIMERB = 0
 
	WHILE NOT IS_CHAR_IN_CAR thug1 any_car_jm6 
	OR NOT IS_CHAR_IN_CAR thug2 any_car_jm6 
	OR NOT IS_CHAR_IN_CAR thug3 any_car_jm6 
		WAIT 0
 
			IF IS_CHAR_DEAD thug1
			OR IS_CHAR_DEAD thug2
			OR IS_CHAR_DEAD thug3
				PRINT_NOW ( JM6_7 ) 5000 1
				GOTO mission_joey6_failed
			ENDIF
 
			IF IS_CAR_DEAD any_car_jm6
				GOTO mission_joey6_failed
			ENDIF
 
			GET_TIME_OF_DAY hours minutes
			IF hours >= 17
				PRINT_NOW ( OUTTIME ) 5000 1
				GOTO mission_joey6_failed
			ENDIF
 
			IF TIMERB > 15000
				GOTO next_robber_bit
			ENDIF
 
	ENDWHILE
 
ENDIF
 
next_robber_bit:
 
//SAMPLE1*********************************************************
LOAD_MISSION_AUDIO J6_A
 
WHILE NOT HAS_MISSION_AUDIO_LOADED
	WAIT 0
ENDWHILE
 
PLAY_MISSION_AUDIO
 
RESTORE_CAMERA_JUMPCUT
APPLY_BRAKES_TO_PLAYERS_CAR Player OFF
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
SET_POLICE_IGNORE_PLAYER Player OFF
SET_EVERYONE_IGNORE_PLAYER Player OFF
 
//END OF PICK UP THUGS CUT_SCENE*******************************************************************************
 
	PRINT_NOW ( JM6_1 ) 5000 1 //"Lets go"
 
WHILE NOT SLIDE_OBJECT Bank_job_door 1087.523 -233.801 11.012 0.0 0.0 0.2 FALSE
	WAIT 0
 
	GET_TIME_OF_DAY hours minutes
	IF hours >= 17
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
	IF IS_CHAR_DEAD thug1
	OR IS_CHAR_DEAD thug2
	OR IS_CHAR_DEAD thug3
		PRINT_NOW ( JM6_7 ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
ENDWHILE
 
	ADD_BLIP_FOR_COORD 1038.0 -700.0 -100.0 blip3_jm6
	//CHANGE_BLIP_DISPLAY blip3_jm6 BLIP_ONLY
	flag_displayed_wanted_message_jm6 = 0
 
 
//GET TO THE BANK
get_to_the_bank:
WAIT 0
 
	IF IS_CAR_DEAD any_car_jm6
		//Do nothing
	ENDIF
 
WHILE NOT IS_PLAYER_STOPPED_IN_AREA_3D player 1040.5 -691.5 14.0 1043.8 -698.5 17.0 TRUE
OR NOT IS_PLAYER_IN_ANY_CAR player
OR IS_WANTED_LEVEL_GREATER Player 0    	
	WAIT 0
 
	IF IS_CAR_DEAD any_car_jm6
		//GO GET ANOTHER ONE	
	ENDIF
 
	IF IS_PLAYER_IN_ANY_CAR Player
		STORE_CAR_PLAYER_IS_IN player any_car_jm6
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug1
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug1 player
			IF blip_for_thug_added1 = 0
				ADD_BLIP_FOR_CHAR thug1 thug1_blip
				blip_for_thug_added1 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug1 30.0 30.0 FALSE
		   		IF blip_for_thug_added1 = 1
					SET_PLAYER_AS_LEADER thug1 player
					REMOVE_BLIP	thug1_blip
					blip_for_thug_added1 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug2 player
			IF blip_for_thug_added2 = 0
				ADD_BLIP_FOR_CHAR thug2 thug2_blip
				blip_for_thug_added2 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug2 30.0 30.0 FALSE
		   		IF blip_for_thug_added2 = 1
					SET_PLAYER_AS_LEADER thug2 player
					REMOVE_BLIP	thug2_blip
					blip_for_thug_added2 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug3 player
			IF blip_for_thug_added3 = 0
				ADD_BLIP_FOR_CHAR thug3 thug3_blip
				blip_for_thug_added3 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug3 30.0 30.0 FALSE
		   		IF blip_for_thug_added3 = 1
					SET_PLAYER_AS_LEADER thug3 player
					REMOVE_BLIP	thug3_blip
					blip_for_thug_added3 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF IS_CHAR_DEAD thug1
	OR IS_CHAR_DEAD thug2
	OR IS_CHAR_DEAD thug3
		PRINT_NOW ( JM6_7 ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
	IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player 1040.5 -691.5 14.0 1043.8 -698.5 17.0 FALSE
		IF IS_WANTED_LEVEL_GREATER player 0
			IF flag_displayed_wanted_message_jm6 = 0
				PRINT_NOW ( WANTED1 ) 5000 1
				flag_displayed_wanted_message_jm6 = 1
			ENDIF
		ENDIF
	ELSE
		IF NOT IS_PLAYER_IN_AREA_3D player 1040.5 -691.5 14.0 1043.8 -698.5 17.0 FALSE
			flag_displayed_wanted_message_jm6 = 0
		ENDIF
	ENDIF
 
	IF IS_PLAYER_IN_AREA_ON_FOOT_3D player 1040.5 -691.5 14.0 1043.8 -698.5 17.0 FALSE
		PRINT_NOW ( JM6_5 ) 5000 1 //"We need a getaway vehicle"
	ELSE
		CLEAR_THIS_PRINT ( JM6_5 )
	ENDIF
 
	GET_TIME_OF_DAY hours minutes
	IF hours >= 17
		PRINT_NOW ( OUTTIME ) 5000 1
		GOTO mission_joey6_failed
	ENDIF
 
ENDWHILE
 
IF IS_PLAYER_IN_MODEL Player CAR_COACH
OR IS_PLAYER_IN_MODEL Player CAR_BUS
	PRINT_NOW ( JM6_6 ) 5000 1 //Go and get a vehicle less conspicuous
	//WAIT 3000	
	GOTO get_to_the_bank
ENDIF
 
IF IS_CHAR_DEAD thug1
OR IS_CHAR_DEAD thug2
OR IS_CHAR_DEAD thug3
	PRINT_NOW ( JM6_7 ) 5000 1
	GOTO mission_joey6_failed
ENDIF
 
IF NOT IS_CHAR_IN_CAR thug1 any_car_jm6
OR NOT IS_CHAR_IN_CAR thug2 any_car_jm6
OR NOT IS_CHAR_IN_CAR thug3 any_car_jm6
	PRINT_NOW ( JM6_7 ) 5000 1 //Go and get a vehicle less conspicuous
	//WAIT 3000	
	GOTO get_to_the_bank
ENDIF
 
// BANK ROBBERY CUT SCENE**************************************************************************************
 
CLEAR_AREA 1037.3 -699.6 15.0 6.0 TRUE
SET_PED_DENSITY_MULTIPLIER 0.0
 
SET_PLAYER_CONTROL Player OFF
SWITCH_WIDESCREEN ON
SET_POLICE_IGNORE_PLAYER Player ON
SET_EVERYONE_IGNORE_PLAYER Player On
APPLY_BRAKES_TO_PLAYERS_CAR Player ON
 
SET_FIXED_CAMERA_POSITION 1036.448 -705.615 14.512 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1036.637 -704.639 14.624 JUMP_CUT
 
	REMOVE_BLIP blip3_jm6
 
//SAMPLE2*********************************************************
 
	LOAD_MISSION_AUDIO J6_B
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
	PLAY_MISSION_AUDIO
 
	PRINT_NOW ( JM6_2 ) 5000 1 //"Wait here"
 
 
	STORE_CAR_PLAYER_IS_IN player any_car_jm6
 
	IF NOT IS_CAR_DEAD any_car_jm6 
		IF NOT IS_CHAR_DEAD thug1
			LEAVE_GROUP thug1
			SET_CHAR_OBJ_LEAVE_CAR thug1 any_car_jm6
		ENDIF
	ENDIF
 
	WAIT 400	
 
	IF NOT IS_CAR_DEAD any_car_jm6 
		IF NOT IS_CHAR_DEAD thug2 
			LEAVE_GROUP thug2
			SET_CHAR_OBJ_LEAVE_CAR thug2 any_car_jm6
		ENDIF
	ENDIF
 
	WAIT 400	
 
	IF NOT IS_CAR_DEAD any_car_jm6	
		IF NOT IS_CHAR_DEAD thug3 
			LEAVE_GROUP thug3
			SET_CHAR_OBJ_LEAVE_CAR thug3 any_car_jm6
		ENDIF
	ENDIF
 
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
 
//WAITING FOR THUGS TO GET OUT OF CAR
 
WHILE NOT objective_count = 3   
 
		WAIT 0
 
		IF IS_CHAR_DEAD thug1
		AND objective_count_done_before1 = 0
			objective_count ++
			objective_count_done_before1 = 1
			thug1_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug2
		AND objective_count_done_before2 = 0
			objective_count ++
			objective_count_done_before2 = 1
			thug2_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug3
		AND objective_count_done_before3 = 0
			objective_count ++
			objective_count_done_before3 = 1
			thug3_is_dead = 1
		ENDIF
 
		IF thug1_is_dead = 1
		AND thug2_is_dead = 1
		AND thug3_is_dead = 1
			GOTO mission_joey6_failed
		ENDIF
 
		IF IS_CAR_DEAD any_car_jm6
			GOTO mission_joey6_failed
		ENDIF
 
		IF NOT IS_CAR_DEAD any_car_jm6
		AND NOT IS_CHAR_DEAD thug1
			IF thug1_is_dead = 0
				IF NOT IS_CHAR_IN_CAR thug1 any_car_jm6 
				AND objective_count_done_before1 = 0					
					SET_CHAR_OBJ_RUN_TO_COORD thug1 1037.4 -699.9
					WAIT 300
					objective_count ++
					objective_count_done_before1 = 1						
				ENDIF
			ENDIF
		ENDIF
 
		IF NOT IS_CAR_DEAD any_car_jm6
		AND NOT IS_CHAR_DEAD thug2
			IF thug2_is_dead = 0
				IF NOT IS_CHAR_IN_CAR thug2 any_car_jm6 
				AND objective_count_done_before2 = 0					
					SET_CHAR_OBJ_RUN_TO_COORD thug2 1037.4 -699.9
					WAIT 300
					objective_count ++
					objective_count_done_before2 = 1						
				ENDIF
			ENDIF
		ENDIF
 
		IF NOT IS_CAR_DEAD any_car_jm6
		AND NOT IS_CHAR_DEAD thug3
			IF thug3_is_dead = 0
				IF NOT IS_CHAR_IN_CAR thug3 any_car_jm6 
				AND objective_count_done_before3 = 0					
					SET_CHAR_OBJ_RUN_TO_COORD thug3 1037.4 -699.9
					objective_count ++
					objective_count_done_before3 = 1						
				ENDIF
			ENDIF
		ENDIF	
 
ENDWHILE
 
//THUGS GO IN THE BANK
 /*
	IF NOT IS_CHAR_DEAD thug1
		SET_CHAR_OBJ_RUN_TO_COORD thug1 1037.4 -699.9
		WAIT 400
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		SET_CHAR_OBJ_RUN_TO_COORD thug2 1037.4 -699.9 
		WAIT 400
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		SET_CHAR_OBJ_RUN_TO_COORD thug3 1037.4 -699.9 
	ENDIF
  */
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
GET_OBJECT_COORDINATES bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z
bankdoor_Y = bankdoor_Y - 1.0
 
GET_OBJECT_COORDINATES bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z
bankdoor2_Y = bankdoor2_Y + 1.0
 
WHILE NOT SLIDE_OBJECT bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z 0.0 0.1 0.0 FALSE
OR NOT SLIDE_OBJECT bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z 0.0 0.1 0.0 FALSE
	WAIT 0
 
ENDWHILE
 
 
TIMERB = 0
 
WHILE NOT objective_count = 3
 
	WAIT 0
 
		IF IS_CHAR_DEAD thug1
		AND objective_count_done_before1 = 0
			objective_count ++
			objective_count_done_before1 = 1
			thug1_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug2
		AND objective_count_done_before2 = 0
			objective_count ++
			objective_count_done_before2 = 1
			thug2_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug3
		AND objective_count_done_before3 = 0
			objective_count ++
			objective_count_done_before3 = 1
			thug3_is_dead = 1
		ENDIF
 
		IF thug1_is_dead = 1
		AND thug2_is_dead = 1
		AND thug3_is_dead = 1
			GOTO mission_joey6_failed
		ENDIF
 
		IF thug1_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug1
			AND objective_count_done_before1 = 0
				SET_CHAR_OBJ_RUN_TO_COORD thug1 1032.9 -700.2		
				objective_count ++
				objective_count_done_before1 = 1		
			ENDIF
		ENDIF
 
		IF thug2_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug2
			AND objective_count_done_before2 = 0
				SET_CHAR_OBJ_RUN_TO_COORD thug2 1032.9 -700.2		
				objective_count ++
				objective_count_done_before2 = 1		
			ENDIF
		ENDIF
 
		IF thug3_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug3
			AND objective_count_done_before3 = 0
				SET_CHAR_OBJ_RUN_TO_COORD thug3 1032.9 -700.2		
				objective_count ++
				objective_count_done_before3 = 1		
			ENDIF
		ENDIF
 
		IF TIMERB > 15000
			IF NOT IS_CHAR_DEAD	thug1
				SET_CHAR_COORDINATES thug1 1037.4 -699.9 13.9
			ENDIF
			IF NOT IS_CHAR_DEAD	thug2
				SET_CHAR_COORDINATES thug2 1037.4 -699.9 13.9
			ENDIF
			IF NOT IS_CHAR_DEAD	thug3
				SET_CHAR_COORDINATES thug3 1037.4 -699.9 13.9
			ENDIF
		ENDIF
 
 
ENDWHILE
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
 
TIMERB = 0
 
WHILE NOT objective_count = 3
 
	WAIT 0
 
		IF IS_CHAR_DEAD thug1
		AND objective_count_done_before1 = 0
			objective_count ++
			objective_count_done_before1 = 1
			thug1_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug2
		AND objective_count_done_before2 = 0
			objective_count ++
			objective_count_done_before2 = 1
			thug2_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug3
		AND objective_count_done_before3 = 0
			objective_count ++
			objective_count_done_before3 = 1
			thug3_is_dead = 1
		ENDIF
 
		IF thug1_is_dead = 1
		AND thug2_is_dead = 1
		AND thug3_is_dead = 1
			GOTO mission_joey6_failed
		ENDIF
 
		IF thug1_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug1
			AND objective_count_done_before1 = 0		
				SET_CHAR_COORDINATES thug1 1104.0 -792.0 14.0
				SET_CHAR_OBJ_WAIT_ON_FOOT thug1
				objective_count ++
				objective_count_done_before1 = 1		
			ENDIF
		ENDIF
 
		IF thug2_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug2
			AND objective_count_done_before2 = 0		
				SET_CHAR_COORDINATES thug2 1102.0 -792.0 14.0
				SET_CHAR_OBJ_WAIT_ON_FOOT thug2
				objective_count ++
				objective_count_done_before2 = 1		
			ENDIF
		ENDIF
 
		IF thug3_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug3
			AND objective_count_done_before3 = 0		
				SET_CHAR_COORDINATES thug3 1100.0 -792.0 14.0
				SET_CHAR_OBJ_WAIT_ON_FOOT thug3
				objective_count ++
				objective_count_done_before3 = 1		
			ENDIF
		ENDIF
 
		IF TIMERB > 15000
			IF NOT IS_CHAR_DEAD	thug1
				SET_CHAR_COORDINATES thug1 1032.9 -700.2 13.9
			ENDIF
			IF NOT IS_CHAR_DEAD	thug2
				SET_CHAR_COORDINATES thug2 1032.9 -700.2 13.9
			ENDIF
			IF NOT IS_CHAR_DEAD	thug3
				SET_CHAR_COORDINATES thug3 1032.9 -700.2 13.9
			ENDIF
		ENDIF
 
ENDWHILE
 
LOAD_MISSION_AUDIO J6_1
 
GET_OBJECT_COORDINATES bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z
bankdoor_Y = bankdoor_Y + 1.0
 
GET_OBJECT_COORDINATES bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z
bankdoor2_Y = bankdoor2_Y - 1.0
 
WHILE NOT SLIDE_OBJECT bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z 0.0 0.1 0.0 FALSE
OR NOT SLIDE_OBJECT bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z 0.0 0.1 0.0 FALSE
	WAIT 0
 
ENDWHILE
 
 
//WAIT 1000
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
	PLAY_MISSION_AUDIO
 
	WHILE NOT HAS_MISSION_AUDIO_FINISHED
		WAIT 0
 
	ENDWHILE
 
WAIT 1000
 
//THUGS COME OUT OF BANK
 
CLEAR_AREA 1037.3 -699.6 15.0 4.0 TRUE
 
GET_OBJECT_COORDINATES bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z
bankdoor_Y = bankdoor_Y - 1.0
 
GET_OBJECT_COORDINATES bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z
bankdoor2_Y = bankdoor2_Y + 1.0
 
WHILE NOT SLIDE_OBJECT bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z 0.0 0.1 0.0 FALSE
OR NOT SLIDE_OBJECT bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z 0.0 0.1 0.0 FALSE
	WAIT 0
 
ENDWHILE
 
	IF NOT IS_CHAR_DEAD thug1		   
	   SET_CHAR_COORDINATES thug1 1032.9 -700.2 15.0
	   SET_CHAR_OBJ_RUN_TO_COORD thug1 1036.9 -700.2
	   //SET_PLAYER_AS_LEADER thug1 player
	ENDIF
 
	WAIT 800
 
	IF NOT IS_CHAR_DEAD thug2
		SET_CHAR_COORDINATES thug2 1032.9 -700.2 15.0
	    SET_CHAR_OBJ_RUN_TO_COORD thug2 1036.9 -700.2
	ENDIF
 
	WAIT 800
 
	IF NOT IS_CHAR_DEAD thug3
		SET_CHAR_COORDINATES thug3 1032.9 -700.2 15.0
	    SET_CHAR_OBJ_RUN_TO_COORD thug3 1036.9 -700.2
	ENDIF
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
 
TIMERB = 0
 
WHILE NOT objective_count = 3
	WAIT 0
 
	IF IS_CHAR_DEAD thug1
	AND objective_count_done_before1 = 0
		objective_count ++
		objective_count_done_before1 = 1
		thug1_is_dead = 1
	ENDIF
 
	IF IS_CHAR_DEAD thug2
	AND objective_count_done_before2 = 0
		objective_count ++
		objective_count_done_before2 = 1
		thug2_is_dead = 1
	ENDIF
 
	IF IS_CHAR_DEAD thug3
	AND objective_count_done_before3 = 0
		objective_count ++
		objective_count_done_before3 = 1
		thug3_is_dead = 1
	ENDIF
 
	IF thug1_is_dead = 1
	AND thug2_is_dead = 1
	AND thug3_is_dead = 1
		GOTO mission_joey6_failed
	ENDIF
 
	IF thug1_is_dead = 0
		IF IS_CHAR_OBJECTIVE_PASSED thug1
		AND objective_count_done_before1 = 0		
			SET_PLAYER_AS_LEADER thug1 player
			objective_count ++
			objective_count_done_before1 = 1		
		ENDIF
	ENDIF
 
	IF thug2_is_dead = 0
		IF IS_CHAR_OBJECTIVE_PASSED thug2
		AND objective_count_done_before2 = 0		
			SET_PLAYER_AS_LEADER thug2 player
			objective_count ++
			objective_count_done_before2 = 1		
		ENDIF
	ENDIF
 
	IF thug3_is_dead = 0
		IF IS_CHAR_OBJECTIVE_PASSED thug3
		AND objective_count_done_before3 = 0		
			SET_PLAYER_AS_LEADER thug3 player
			objective_count ++
			objective_count_done_before3 = 1		
		ENDIF
	ENDIF
 
	IF TIMERB > 15000
		IF NOT IS_CHAR_DEAD	thug1
			SET_CHAR_COORDINATES thug1 1036.9 -700.2 13.9
		ENDIF
		IF NOT IS_CHAR_DEAD	thug2
			SET_CHAR_COORDINATES thug2 1036.9 -700.2 13.9
		ENDIF
		IF NOT IS_CHAR_DEAD	thug3
			SET_CHAR_COORDINATES thug3 1036.9 -700.2 13.9
		ENDIF
	ENDIF
 
ENDWHILE
 
ADD_CONTINUOUS_SOUND 1034.8 -700.1 15.0 SOUND_BANK_ALARM_LOOP_L joey_alarm_loop 
sound_already_created_before = 1
 
//SAMPLE3*********************************************************
	LOAD_MISSION_AUDIO J6_D
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
	PLAY_MISSION_AUDIO
 
 
ALTER_WANTED_LEVEL_NO_DROP Player 3
 
	GET_OBJECT_COORDINATES bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z
	bankdoor_Y = bankdoor_Y + 1.0
 
	GET_OBJECT_COORDINATES bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z
	bankdoor2_Y = bankdoor2_Y - 1.0
 
	WHILE NOT SLIDE_OBJECT bankdoor1 bankdoor_X bankdoor_Y bankdoor_Z 0.0 0.1 0.0 FALSE
	OR NOT SLIDE_OBJECT bankdoor2 bankdoor2_X bankdoor2_Y bankdoor2_Z 0.0 0.1 0.0 FALSE
		WAIT 0
 
	ENDWHILE
 
WHILE NOT HAS_MISSION_AUDIO_FINISHED
	WAIT 0
 
ENDWHILE
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA_JUMPCUT
SET_POLICE_IGNORE_PLAYER Player OFF
SET_EVERYONE_IGNORE_PLAYER Player OFF
APPLY_BRAKES_TO_PLAYERS_CAR Player Off
SET_PED_DENSITY_MULTIPLIER 1.0
 
 
TIMERB = 0
 
WHILE NOT objective_count = 3 //WAITING FOR THUGS TO GET BACK INTO CAR  
 
	WAIT 0
 
	IF IS_CHAR_DEAD thug1
	AND objective_count_done_before1 = 0
		objective_count ++
		objective_count_done_before1 = 1
		thug1_is_dead = 1
	ENDIF
 
	IF IS_CHAR_DEAD thug2
	AND objective_count_done_before2 = 0
		objective_count ++
		objective_count_done_before2 = 1
		thug2_is_dead = 1
	ENDIF
 
	IF IS_CHAR_DEAD thug3
	AND objective_count_done_before3 = 0
		objective_count ++
		objective_count_done_before3 = 1
		thug3_is_dead = 1
	ENDIF
 
 
	IF thug1_is_dead = 1
	AND thug2_is_dead = 1
	AND thug3_is_dead = 1
		GOTO mission_joey6_failed
	ENDIF
 
//	STORE_CAR_PLAYER_IS_IN player any_car_jm6
//	maybe should stop player leaving this car while the thugs get in
 
	IF IS_CAR_DEAD any_car_jm6
		GOTO mission_joey6_failed
	ENDIF
 
	IF thug1_is_dead = 0
		IF IS_CHAR_IN_CAR thug1 any_car_jm6 
		AND objective_count_done_before1 = 0		
			objective_count ++
			objective_count_done_before1 = 1		
		ENDIF
	ENDIF
 
	IF thug2_is_dead = 0
		IF IS_CHAR_IN_CAR thug2 any_car_jm6 
		AND objective_count_done_before2 = 0		
			objective_count ++
			objective_count_done_before2 = 1		
		ENDIF
	ENDIF
 
	IF thug3_is_dead = 0
		IF IS_CHAR_IN_CAR thug3 any_car_jm6 
		AND objective_count_done_before3 = 0		
			objective_count ++
			objective_count_done_before3 = 1		
		ENDIF
	ENDIF
	/*
	IF TIMERB > 15000
		IF NOT IS_CAR_DEAD any_car_jm6
			IF NOT IS_CHAR_DEAD	thug1
				//WARP_CHAR_INTO_CAR thug1 any_car_jm6
				//WARP_CHAR_INTO_CAR_AS_PASSERNGER thug1 any_car_jm6
			ENDIF
			IF NOT IS_CHAR_DEAD	thug2
				//WARP_CHAR_INTO_CAR thug2 any_car_jm6
				//WARP_CHAR_INTO_CAR_AS_PASSERNGER thug1 any_car_jm6
			ENDIF
			IF NOT IS_CHAR_DEAD	thug3
				//WARP_CHAR_INTO_CAR thug3 any_car_jm6
				//WARP_CHAR_INTO_CAR_AS_PASSERNGER thug1 any_car_jm6
			ENDIF
		ENDIF
	ENDIF
	*/
ENDWHILE	
 
//END OF BANK ROBBERY CUT SCENE********************************************************************************
 
	ADD_BLIP_FOR_COORD 1086.0 -227.0 -100.0 blip2_jm6
	CHANGE_BLIP_DISPLAY blip2_jm6 BLIP_ONLY
 
//SAMPLE4*********************************************************
	LOAD_MISSION_AUDIO J6_C
 
	WHILE NOT HAS_MISSION_AUDIO_LOADED
		WAIT 0
	ENDWHILE
 
	PLAY_MISSION_AUDIO
 
	PRINT_NOW ( JM6_3 ) 3000 1 //"get us out of here"
 
	//PRINT_SOON ( JM6_4 ) 5000 1 //"get us out of here"
 
 
//Get back to warehouse
 
back_to_safe_house:
 
WAIT 0
 
	IF IS_CAR_DEAD any_car_jm6
		//GO GET ANOTHER ONE	
	ENDIF
 
WHILE NOT IS_PLAYER_STOPPED_IN_AREA_2D player 1089.9 -223.9 1084.5 -228.5 TRUE
OR NOT IS_PLAYER_IN_ANY_CAR player 	  
OR IS_WANTED_LEVEL_GREATER Player 0    	
	WAIT 0
 
	IF IS_CAR_DEAD any_car_jm6
		//GO GET ANOTHER ONE	
	ENDIF
 
	IF IS_PLAYER_IN_ANY_CAR Player
		STORE_CAR_PLAYER_IS_IN player any_car_jm6
	ENDIF
 
	IF IS_CHAR_DEAD thug1
	AND IS_CHAR_DEAD thug2
	AND IS_CHAR_DEAD thug3
		PRINT_NOW ( JM6_8 )	5000 1
		GOTO mission_joey6_failed
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug1
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug1 player
			IF blip_for_thug_added1 = 0
				ADD_BLIP_FOR_CHAR thug1 thug1_blip
				blip_for_thug_added1 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug1 30.0 30.0 FALSE
		   		IF blip_for_thug_added1 = 1
					SET_PLAYER_AS_LEADER thug1 player
					REMOVE_BLIP	thug1_blip
					blip_for_thug_added1 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug2 player
			IF blip_for_thug_added2 = 0
				ADD_BLIP_FOR_CHAR thug2 thug2_blip
				blip_for_thug_added2 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug2 30.0 30.0 FALSE
		   		IF blip_for_thug_added2 = 1
					SET_PLAYER_AS_LEADER thug2 player
					REMOVE_BLIP	thug2_blip
					blip_for_thug_added2 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		IF NOT IS_CHAR_IN_PLAYERS_GROUP	thug3 player
			IF blip_for_thug_added3 = 0
				ADD_BLIP_FOR_CHAR thug3 thug3_blip
				blip_for_thug_added3 = 1
			ENDIF
 
			IF LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug3 30.0 30.0 FALSE
		   		IF blip_for_thug_added3 = 1
					SET_PLAYER_AS_LEADER thug3 player
					REMOVE_BLIP	thug3_blip
					blip_for_thug_added3 = 0
				ENDIF
			ENDIF
	   	ENDIF	
	ENDIF
 
	IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D player 1089.9 -223.9 1084.5 -228.5 FALSE
		IF IS_WANTED_LEVEL_GREATER player 0
			IF flag_displayed_wanted_message_jm6 = 0
				PRINT_NOW ( WANTED1 ) 5000 1
				flag_displayed_wanted_message_jm6 = 1
			ENDIF
		ENDIF
	ELSE
		IF NOT IS_PLAYER_IN_AREA_2D player 1089.9 -223.9 1084.5 -228.5 FALSE
			flag_displayed_wanted_message_jm6 = 0
		ENDIF
	ENDIF
 
	IF IS_PLAYER_IN_AREA_ON_FOOT_2D player 1089.9 -223.9 1084.5 -228.5 TRUE
		PRINT_NOW ( EBAL_5 ) 5000 1
	ELSE
		CLEAR_THIS_PRINT EBAL_5
	ENDIF
 
ENDWHILE
 
 
//THUGS GO BACK INTO SAFEHOUSE CUT_SCENE***********************************************************************
 
IF NOT IS_CHAR_DEAD thug1
	IF NOT IS_CHAR_IN_PLAYERS_GROUP thug1 player
		PRINT_NOW ( HEY2 ) 4000 1
		GOTO back_to_safe_house
	ENDIF
ENDIF
 
IF NOT IS_CHAR_DEAD thug2
	IF NOT IS_CHAR_IN_PLAYERS_GROUP thug2 player
		PRINT_NOW ( HEY2 ) 4000 1
		GOTO back_to_safe_house
	ENDIF
ENDIF
 
IF NOT IS_CHAR_DEAD thug3
	IF NOT IS_CHAR_IN_PLAYERS_GROUP thug3 player
		PRINT_NOW ( HEY2 ) 4000 1
		GOTO back_to_safe_house
	ENDIF
ENDIF
 
CLEAR_AREA 1087.7 -229.2 8.0 6.0 TRUE
 
SET_PLAYER_CONTROL Player Off
SWITCH_WIDESCREEN ON
SET_POLICE_IGNORE_PLAYER Player On
SET_EVERYONE_IGNORE_PLAYER Player On
 
SET_FIXED_CAMERA_POSITION 1098.781 -228.929 16.723 0.0 0.0 0.0
POINT_CAMERA_AT_POINT 1098.005 -229.116 16.12 JUMP_CUT
 
	IF NOT IS_CAR_DEAD any_car_jm6
		APPLY_BRAKES_TO_PLAYERS_CAR Player On
 
		IF NOT IS_CHAR_DEAD thug1
			LEAVE_GROUP thug1
			IF IS_CHAR_IN_ANY_CAR thug1
				STORE_CAR_CHAR_IS_IN thug1 any_car_jm6
				SET_CHAR_OBJ_LEAVE_CAR thug1 any_car_jm6
			ENDIF
		ENDIF
 
		WAIT 400
 
		IF NOT IS_CHAR_DEAD thug2
			LEAVE_GROUP thug2
			IF IS_CHAR_IN_ANY_CAR thug2
				STORE_CAR_CHAR_IS_IN thug2 any_car_jm6
				SET_CHAR_OBJ_LEAVE_CAR thug2 any_car_jm6
			ENDIF
		ENDIF
 
		WAIT 400
 
		IF NOT IS_CHAR_DEAD thug3
			LEAVE_GROUP thug3
			IF IS_CHAR_IN_ANY_CAR thug3
				STORE_CAR_CHAR_IS_IN thug3 any_car_jm6
				SET_CHAR_OBJ_LEAVE_CAR thug3 any_car_jm6
			ENDIF
		ENDIF
 
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug1
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug1 30.0 30.0 FALSE
			IF NOT IS_CHAR_DEAD	thug1
				MARK_CHAR_AS_NO_LONGER_NEEDED thug1
			ENDIF
			//thug1_is_dead = 1
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug2 30.0 30.0 FALSE
			IF NOT IS_CHAR_DEAD	thug2
				MARK_CHAR_AS_NO_LONGER_NEEDED thug2
			ENDIF
			//thug2_is_dead = 1
		ENDIF
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		IF NOT LOCATE_PLAYER_ANY_MEANS_CHAR_2D Player thug3 30.0 30.0 FALSE
			IF NOT IS_CHAR_DEAD	thug3
				MARK_CHAR_AS_NO_LONGER_NEEDED thug3
			ENDIF
			//thug3_is_dead = 1
		ENDIF
	ENDIF
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
WHILE NOT SLIDE_OBJECT Bank_job_door 1087.523 -233.801 14.012 0.0 0.0 0.2 FALSE
	WAIT 0
 
ENDWHILE
 
WHILE NOT objective_count = 3 //WAITING FOR THUGS TO GET OUT OF CAR  
 
		WAIT 0
 
		IF IS_CHAR_DEAD thug1
			IF objective_count_done_before1 = 0
				objective_count ++
				objective_count_done_before1 = 1
				thug1_is_dead = 1
			ENDIF
		ENDIF
 
		IF IS_CHAR_DEAD thug2
		AND objective_count_done_before2 = 0
			objective_count ++
			objective_count_done_before2 = 1
			thug2_is_dead = 1
		ENDIF
 
 
		IF IS_CHAR_DEAD thug3
		AND objective_count_done_before3 = 0
			objective_count ++
			objective_count_done_before3 = 1
			thug3_is_dead = 1
		ENDIF
 
		IF thug1_is_dead = 1
		AND thug2_is_dead = 1
		AND thug3_is_dead = 1
			GOTO mission_joey6_failed
		ENDIF
 
	IF NOT IS_CAR_DEAD any_car_jm6
 
		IF thug1_is_dead = 0
			IF NOT IS_CHAR_IN_CAR thug1	any_car_jm6	    
			AND objective_count_done_before1 = 0
				//SET_CHAR_OBJ_WAIT_ON_FOOT thug1
				SET_CHAR_OBJ_RUN_TO_COORD thug1 1087.0 -238.6		
				objective_count ++
				objective_count_done_before1 = 1		
			ENDIF
		ENDIF
 
		IF thug2_is_dead = 0
			IF NOT IS_CHAR_IN_CAR thug2 any_car_jm6			 
			AND objective_count_done_before2 = 0
				//SET_CHAR_OBJ_WAIT_ON_FOOT thug2
				SET_CHAR_OBJ_RUN_TO_COORD thug2 1087.5 -238.6		
				objective_count ++
				objective_count_done_before2 = 1		
			ENDIF
		ENDIF
 
		IF thug3_is_dead = 0
			IF NOT IS_CHAR_IN_CAR thug3	any_car_jm6		 
			AND objective_count_done_before3 = 0
				//SET_CHAR_OBJ_WAIT_ON_FOOT thug3
				SET_CHAR_OBJ_RUN_TO_COORD thug3 1088.0 -238.6		
				objective_count ++
				objective_count_done_before3 = 1		
			ENDIF
		ENDIF
 
	ENDIF
 
ENDWHILE
 
 
REMOVE_BLIP blip1_jm6
 
	IF NOT IS_CHAR_DEAD thug1
		SET_CHAR_OBJ_RUN_TO_COORD thug1 1087.0 -238.6	
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		SET_CHAR_OBJ_RUN_TO_COORD thug2 1087.5 -238.6
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		SET_CHAR_OBJ_RUN_TO_COORD thug3 1088.0 -238.6
	ENDIF
 
objective_count = 0
objective_count_done_before1 = 0
objective_count_done_before2 = 0
objective_count_done_before3 = 0
 
TIMERB = 0
 
WHILE NOT objective_count = 3
 
	WAIT 0
 
		IF IS_CHAR_DEAD thug1
		AND objective_count_done_before1 = 0
			objective_count ++
			objective_count_done_before1 = 1
			thug1_is_dead = 1
		ENDIF
 
		IF IS_CHAR_DEAD thug2
		AND objective_count_done_before2 = 0
			objective_count ++
			objective_count_done_before2 = 1
			thug2_is_dead = 1
		ENDIF
 
 
		IF IS_CHAR_DEAD thug3
		AND objective_count_done_before3 = 0
			objective_count ++
			objective_count_done_before3 = 1
			thug3_is_dead = 1
		ENDIF
 
 
		IF thug1_is_dead = 1
		AND thug2_is_dead = 1
		AND thug3_is_dead = 1
			GOTO mission_joey6_failed
		ENDIF
 
		IF thug1_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug1
			AND objective_count_done_before1 = 0		// GSW - could maybe use objective_count_done_before1 here
				objective_count ++
				objective_count_done_before1 = 1		// GSW - could maybe use objective_count_done_before1 here
			ENDIF
		ENDIF
 
		IF thug2_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug2
			AND objective_count_done_before2 = 0		// GSW - could maybe use objective_count_done_before2 here
				objective_count ++
				objective_count_done_before2 = 1		// GSW - could maybe use objective_count_done_before2 here
			ENDIF
		ENDIF
 
		IF thug3_is_dead = 0
			IF IS_CHAR_OBJECTIVE_PASSED thug3
			AND objective_count_done_before3 = 0		// GSW - could maybe use objective_count_done_before3 here
				objective_count ++
				objective_count_done_before3 = 1		// GSW - could maybe use objective_count_done_before3 here
			ENDIF
		ENDIF
 
		IF TIMERB > 15000
			IF NOT IS_CHAR_DEAD	thug1
				SET_CHAR_COORDINATES thug1 1087.0 -238.6 10.0
			ENDIF
			IF NOT IS_CHAR_DEAD	thug2
				SET_CHAR_COORDINATES thug2 1087.5 -238.6 10.0
			ENDIF
			IF NOT IS_CHAR_DEAD	thug3
				SET_CHAR_COORDINATES thug3 1088.0 -238.6 10.0
			ENDIF
		ENDIF
 
ENDWHILE
 
	IF NOT IS_CHAR_DEAD thug1
		SET_CHAR_OBJ_WAIT_ON_FOOT thug1
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug2
		SET_CHAR_OBJ_WAIT_ON_FOOT thug2
	ENDIF
 
	IF NOT IS_CHAR_DEAD thug3
		SET_CHAR_OBJ_WAIT_ON_FOOT thug3
	ENDIF
 
 
WHILE NOT SLIDE_OBJECT Bank_job_door 1087.523 -233.801 11.012 0.0 0.0 0.1 FALSE
	WAIT 0
 
ENDWHILE
 
SET_PLAYER_CONTROL Player ON
SWITCH_WIDESCREEN OFF
RESTORE_CAMERA_JUMPCUT
SET_POLICE_IGNORE_PLAYER Player OFF
SET_EVERYONE_IGNORE_PLAYER Player OFF
APPLY_BRAKES_TO_PLAYERS_CAR Player Off
 
//THUGS GO BACK INTO SAFEHOUSE CUT_SCENE***********************************************************************
 
 
GOTO mission_joey6_passed
 
 
 
// Mission Joey6 failed
 
mission_joey6_failed:
PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed"
RETURN
 
 
 
// mission joey6 passed
 
mission_joey6_passed:
 
flag_joey_mission6_passed = 1
	IF NOT IS_CHAR_DEAD thug1
		thugs_score = thugs_score + 10000
	ENDIF
	DELETE_CHAR thug1
 
	IF NOT IS_CHAR_DEAD thug2
		thugs_score = thugs_score + 10000
	ENDIF
	DELETE_CHAR thug2
 
	IF NOT IS_CHAR_DEAD thug3
		thugs_score = thugs_score + 10000	
	ENDIF
	DELETE_CHAR thug3
PLAY_MISSION_PASSED_TUNE 1
PRINT_WITH_NUMBER_BIG ( M_PASS ) thugs_score 5000 1 //"Mission Passed!"
CLEAR_WANTED_LEVEL player
ADD_SCORE player thugs_score
REGISTER_MISSION_PASSED JM6
PLAYER_MADE_PROGRESS 1
REMOVE_BLIP joey_contact_blip
RETURN
 
 
// mission cleanup
 
mission_cleanup_joey6:
 
flag_player_on_mission = 0
flag_player_on_joey_mission = 0
IF sound_already_created_before = 1
	REMOVE_SOUND joey_alarm_loop
ENDIF
REMOVE_BLIP blip1_jm6
REMOVE_BLIP blip3_jm6
REMOVE_BLIP blip2_jm6
REMOVE_BLIP	thug1_blip
REMOVE_BLIP	thug2_blip
REMOVE_BLIP	thug3_blip
SET_PED_DENSITY_MULTIPLIER 1.0
UNLOAD_SPECIAL_CHARACTER 2
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