R4gn0r0k

hood4.sc

Feb 4th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 KB | None | 0 0
  1. MISSION_START
  2. // *******************************************************************************************
  3. // *******************************************************************************************
  4. // *******************************************************************************************
  5. // *************************************Hood Mission 4****************************************
  6. // ****************************************The Race*******************************************
  7. // *******************************************************************************************
  8. // *******************************************************************************************
  9. // *******************************************************************************************
  10.  
  11. SCRIPT_NAME hood4
  12.  
  13. // Mission start stuff
  14.  
  15. GOSUB mission_start_hood4
  16.  
  17. IF HAS_DEATHARREST_BEEN_EXECUTED
  18. GOSUB mission_hood4_failed
  19. ENDIF
  20.  
  21. GOSUB mission_cleanup_hood4
  22.  
  23. MISSION_END
  24.  
  25.  
  26. // Variables for mission
  27.  
  28. VAR_INT total_no_pills_carried_hm4 //Total no of pills eaten since race started
  29.  
  30. VAR_INT radar_blip_coord1_hm4
  31.  
  32. VAR_INT no_of_pills_carried_hm4 //no of pills player is carrying
  33.  
  34. VAR_INT flag_player_in_area_hm4
  35.  
  36. VAR_INT timer_hm4
  37.  
  38. VAR_INT car_hm4
  39.  
  40. VAR_INT radar_blip_car1_hm4
  41.  
  42. VAR_INT flag_player_had_car_message_hm4
  43.  
  44. VAR_INT flag_blip_added_hm4
  45.  
  46. VAR_INT radar_blip_coord2_hm4
  47.  
  48.  
  49. // ***************************************Mission Start*************************************
  50.  
  51.  
  52. mission_start_hood4:
  53.  
  54. flag_player_on_mission = 1
  55.  
  56. flag_player_on_hood_mission = 1
  57.  
  58. REGISTER_MISSION_GIVEN
  59.  
  60. WAIT 0
  61.  
  62. total_no_pills_carried_hm4 = 0
  63.  
  64. flag_player_in_area_hm4 = 0
  65.  
  66. timer_hm4 = 361000 // 6 mins
  67.  
  68. flag_player_had_car_message_hm4 = 0
  69.  
  70. flag_blip_added_hm4 = 0
  71.  
  72. {
  73.  
  74. // *******************************************START OF CUTSCENE*****************************
  75.  
  76. /*
  77. IF CAN_PLAYER_START_MISSION Player
  78. MAKE_PLAYER_SAFE_FOR_CUTSCENE Player
  79. ELSE
  80. GOTO mission_hood4_failed
  81. ENDIF
  82.  
  83. SET_FADING_COLOUR 0 0 0
  84.  
  85. DO_FADE 1500 FADE_OUT
  86.  
  87. PRINT_BIG ( HM_4 ) 15000 2 //"GOLD GRAB"
  88.  
  89. SWITCH_STREAMING OFF
  90.  
  91. //LOAD_SPECIAL_MODEL cut_obj1 PLAYERH
  92.  
  93. WHILE GET_FADING_STATUS
  94.  
  95. WAIT 0
  96.  
  97. ENDWHILE
  98. */
  99.  
  100. SET_PED_DENSITY_MULTIPLIER 0.0
  101.  
  102. CLEAR_AREA_OF_CHARS -414.57 97.73 1.0 -589.29 -101.77 20.0
  103.  
  104. //LOAD_ALL_MODELS_NOW
  105.  
  106. //WHILE NOT HAS_MODEL_LOADED cut_obj1
  107.  
  108. // WAIT 0
  109.  
  110. //ENDWHILE
  111.  
  112. LOAD_CUTSCENE hd_ph4
  113. SET_CUTSCENE_OFFSET -444.714 -6.321 2.9
  114.  
  115. CREATE_CUTSCENE_OBJECT PED_PLAYER cs_player
  116. SET_CUTSCENE_ANIM cs_player player
  117.  
  118. //CREATE_CUTSCENE_HEAD cs_player CUT_OBJ1 cs_playerhead
  119. //SET_CUTSCENE_HEAD_ANIM cs_playerhead player
  120.  
  121.  
  122. DO_FADE 1500 FADE_IN
  123.  
  124. SWITCH_STREAMING ON
  125.  
  126. START_CUTSCENE
  127.  
  128. // Displays cutscene text
  129.  
  130.  
  131. GET_CUTSCENE_TIME cs_time
  132.  
  133. WHILE cs_time < 2096
  134. WAIT 0
  135. GET_CUTSCENE_TIME cs_time
  136. ENDWHILE
  137. PRINT_NOW ( HM4_A ) 10000 1 //"Yo a Federal..."
  138.  
  139. WHILE cs_time < 5840
  140. WAIT 0
  141. GET_CUTSCENE_TIME cs_time
  142. ENDWHILE
  143.  
  144. PRINT_NOW ( HM4_B ) 10000 1 //"There's platinum all..."
  145.  
  146. WHILE cs_time < 8171
  147. WAIT 0
  148. GET_CUTSCENE_TIME cs_time
  149. ENDWHILE
  150.  
  151. PRINT_NOW ( HM4_C ) 10000 1 //"Get a car..."
  152.  
  153. WHILE cs_time < 11161
  154. WAIT 0
  155. GET_CUTSCENE_TIME cs_time
  156. ENDWHILE
  157.  
  158. PRINT_NOW ( HM4_F ) 10000 1 //"You can drop..."
  159.  
  160. WHILE cs_time < 13963
  161. WAIT 0
  162. GET_CUTSCENE_TIME cs_time
  163. ENDWHILE
  164.  
  165. PRINT_NOW ( HM4_G ) 10000 1 //"This platinum..."
  166.  
  167. WHILE cs_time < 17683
  168. WAIT 0
  169. GET_CUTSCENE_TIME cs_time
  170. ENDWHILE
  171.  
  172. PRINT_NOW ( HM4_H ) 10000 1 //"So make regular drop..."
  173.  
  174. WHILE cs_time < 19787
  175. WAIT 0
  176. GET_CUTSCENE_TIME cs_time
  177. ENDWHILE
  178.  
  179. CLEAR_THIS_PRINT ( HM4_H )
  180.  
  181. WHILE cs_time < 20433
  182. WAIT 0
  183. GET_CUTSCENE_TIME cs_time
  184. ENDWHILE
  185.  
  186. DO_FADE 1500 FADE_OUT
  187.  
  188. WHILE NOT HAS_CUTSCENE_FINISHED
  189. WAIT 0
  190.  
  191. ENDWHILE
  192.  
  193. CLEAR_PRINTS
  194.  
  195. WHILE GET_FADING_STATUS
  196. WAIT 0
  197. ENDWHILE
  198.  
  199. CLEAR_CUTSCENE
  200.  
  201. //SWITCH_STREAMING ON
  202.  
  203. WAIT 500
  204.  
  205. DO_FADE 1500 FADE_IN
  206.  
  207. //MARK_MODEL_AS_NO_LONGER_NEEDED CUT_OBJ1
  208.  
  209. SET_PED_DENSITY_MULTIPLIER 1.0
  210.  
  211. // *********************************************END OF CUTSCENE*****************************
  212.  
  213. PRINT_NOW ( HM4_D ) 5000 1 //"Get a vehicle!"
  214.  
  215. WHILE NOT IS_PLAYER_IN_ANY_CAR player
  216.  
  217. WAIT 0
  218.  
  219. ENDWHILE
  220.  
  221. STORE_CAR_PLAYER_IS_IN player car_hm4
  222.  
  223. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 car_hm4
  224.  
  225. //REMOVE_BLIP radar_blip_car1_hm4
  226.  
  227. ADD_BLIP_FOR_COORD -1080.0 -163.2 -100.0 radar_blip_coord2_hm4
  228.  
  229. PRINT_NOW ( HM4_1 ) 7000 1 //"Head to the location where the cargo is scattered!"
  230.  
  231. START_PACMAN_SCRAMBLE -1080.0 -163.2 -100.0 100.0 90 // 90 tokens are created
  232.  
  233. DISPLAY_ONSCREEN_TIMER timer_hm4
  234.  
  235. DISPLAY_ONSCREEN_COUNTER_WITH_STRING total_no_pills_carried_hm4 COUNTER_DISPLAY_NUMBER collect
  236.  
  237. // waiting for the player to get the correct number of pills
  238.  
  239. WHILE NOT total_no_pills_carried_hm4 >= 30
  240.  
  241. WAIT 0
  242.  
  243. GET_NUMBER_OF_POWER_PILLS_CARRIED no_of_pills_carried_hm4
  244.  
  245. IF IS_PLAYER_IN_AREA_3D player -824.7 -165.5 32.8 -843.5 -171.7 37.0 FALSE
  246. CLEAR_WANTED_LEVEL player
  247. ENDIF
  248.  
  249. // Checks to see if any pills are carried and switches off airport blip and puts on the drop off blip
  250.  
  251. IF no_of_pills_carried_hm4 > 0
  252.  
  253. IF flag_blip_added_hm4 = 0
  254. REMOVE_BLIP radar_blip_coord2_hm4
  255. ADD_BLIP_FOR_COORD -844.9 -169.6 32.8 radar_blip_coord1_hm4 // Coords for where the gold is to be dropped off
  256. PRINT_NOW ( HM4_2 ) 7000 1 //"Remember when the vehicle becomes too heavy and slow goto the garage and drop off the cargo."
  257. flag_blip_added_hm4 = 1
  258. ENDIF
  259.  
  260. ENDIF
  261.  
  262. // Checks and removes the no of pills that the player has collected
  263.  
  264. IF IS_PLAYER_IN_ANY_CAR player
  265.  
  266. STORE_CAR_PLAYER_IS_IN player car_hm4
  267. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 car_hm4
  268.  
  269. IF IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player -824.7 -165.5 32.8 -843.5 -171.7 37.0 FALSE
  270. AND flag_player_in_area_hm4 = 0
  271. total_no_pills_carried_hm4 += no_of_pills_carried_hm4
  272. ADD_ONE_OFF_SOUND -834.9 -168.8 33.9 SOUND_UNLOAD_GOLD
  273. CLEAR_NUMBER_OF_POWER_PILLS_CARRIED
  274. flag_player_in_area_hm4 = 1
  275. ENDIF
  276.  
  277. IF IS_PLAYER_IN_CAR player car_hm4
  278. AND NOT IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D player -824.7 -165.5 32.8 -843.5 -171.7 37.0 FALSE
  279. AND flag_player_in_area_hm4 = 1
  280. flag_player_in_area_hm4 = 0
  281. ENDIF
  282.  
  283. ENDIF
  284.  
  285. // Checks for the player getting in and out of the car
  286.  
  287. IF NOT IS_PLAYER_IN_ANY_CAR player
  288.  
  289. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 -1
  290.  
  291. IF flag_player_had_car_message_hm4 = 0
  292. PRINT_NOW ( IN_VEH2 ) 5000 1 //"Get into the vehicle!"
  293. IF flag_blip_added_hm4 = 1
  294. REMOVE_BLIP radar_blip_coord1_hm4
  295. ENDIF
  296. flag_player_had_car_message_hm4 = 1
  297. ENDIF
  298.  
  299. ELSE
  300.  
  301. STORE_CAR_PLAYER_IS_IN player car_hm4
  302. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 car_hm4
  303.  
  304. IF flag_player_had_car_message_hm4 = 1
  305. IF flag_blip_added_hm4 = 1
  306. ADD_BLIP_FOR_COORD -844.9 -169.6 32.8 radar_blip_coord1_hm4
  307. ENDIF
  308. flag_player_had_car_message_hm4 = 0
  309. ENDIF
  310.  
  311. ENDIF
  312.  
  313. IF timer_hm4 = 0
  314. PRINT_NOW ( OUTTIME ) 5000 1 //"Your out of time!"
  315. GOTO mission_hood4_failed
  316. ENDIF
  317.  
  318. ENDWHILE
  319.  
  320. REMOVE_BLIP radar_blip_coord1_hm4
  321.  
  322. }
  323.  
  324. GOTO mission_hood4_passed
  325.  
  326.  
  327.  
  328. // Mission hood4 failed
  329.  
  330. mission_hood4_failed:
  331.  
  332. PRINT_BIG ( M_FAIL ) 5000 1 //"Mission Failed!"
  333.  
  334. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 -1
  335.  
  336. IF HAS_PLAYER_BEEN_ARRESTED player
  337. OVERRIDE_POLICE_STATION_LEVEL LEVEL_SUBURBAN
  338. ENDIF
  339.  
  340. IF IS_PLAYER_DEAD player
  341. OVERRIDE_HOSPITAL_LEVEL LEVEL_SUBURBAN
  342. ENDIF
  343.  
  344. RETURN
  345.  
  346.  
  347.  
  348.  
  349. // mission hood4 passed
  350.  
  351. mission_hood4_passed:
  352.  
  353. flag_hood_mission4_passed = 1
  354. REGISTER_MISSION_PASSED ( HM_4 )
  355. PLAYER_MADE_PROGRESS 1
  356. PRINT_WITH_NUMBER_BIG ( M_PASS ) 25000 5000 1 //Mission Passed!"
  357. PLAY_MISSION_PASSED_TUNE 1
  358. ADD_SCORE player 25000
  359. CLEAR_WANTED_LEVEL player
  360. START_NEW_SCRIPT hood_mission5_loop
  361. RETURN
  362.  
  363.  
  364.  
  365. // mission cleanup
  366.  
  367. mission_cleanup_hood4:
  368.  
  369. flag_player_on_mission = 0
  370. flag_player_on_hood_mission = 0
  371. SET_TARGET_CAR_FOR_MISSION_GARAGE garage_hm4 -1
  372. CLEAR_NUMBER_OF_POWER_PILLS_CARRIED
  373. CLEAR_PACMAN
  374. REMOVE_BLIP radar_blip_coord1_hm4
  375. REMOVE_BLIP radar_blip_coord2_hm4
  376. CLEAR_ONSCREEN_TIMER timer_hm4
  377. CLEAR_ONSCREEN_COUNTER total_no_pills_carried_hm4 // TEST STUFF
  378. MISSION_HAS_FINISHED
  379. RETURN
Add Comment
Please, Sign In to add comment