Advertisement
Guest User

Untitled

a guest
Nov 28th, 2019
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.53 KB | None | 0 0
  1. {$CLEO}
  2. {---------- PLAYER 2 - DROP IN, DROP OUT! --------------------
  3. Autor: rerun_aaap
  4. Credits to: 1.Nights744, for implementing the 2-Player mode in PC through CLEO scripts
  5. 2.Marsi4eg, for the features added in his mod 2-Player Mode Enhancements
  6. 3.skatefilter5, for the idea of having the second player spawn out of nothing
  7. And the whole GTAForums community, learned a lot of CLEO scripting there :)
  8.  
  9. This script is basically a mix of the other three scripts,
  10. putted together in a way that made the concept of 2-player mode more fast, more fun,
  11. with more features and easier to understand for new players
  12.  
  13. Variables used:
  14. 0@v (.ini)CheatCode
  15. 1@ (.ini)Player2PressStart
  16. 2@ Actor Angle/Random Fighting Style/Player 2 Armor
  17. 3@ (.ini)Distance Limit
  18. 4@ (.ini)Friendly Fire
  19. 5@ "Player Markers" Switch
  20. 6@ Player 1 Marker
  21. 7@ Player 2 Marker
  22. 8@ Player 1 Car
  23. 9@ Player 2 Car
  24. 10@ Random Player 2 Skin
  25. 11@ (.ini)ID1
  26. 12@ (.ini)ID2
  27. 13@ (.ini)ID3
  28. 14@ (.ini)ID4
  29. 15@ (.ini)ID5
  30. 16@ (.ini)ID6
  31. 17@ (.ini)ID7
  32. 18@ (.ini)ID8
  33. 19@ (.ini)ID9
  34. 20@ (.ini)ID10
  35. 21@ (.ini)PlayerIndicator
  36. }
  37. if
  38. 0AAB: file_exists "cleo\Player 2 - Drop In, Drop Out!.ini"
  39. then
  40. 0AF4: 0@v = read_string_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "Activation" key "CheatCode"
  41. 0AF0: 1@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "Activation" key "Player2PressStart"
  42.  
  43. 0AF0: 11@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID1"
  44. 0AF0: 12@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID2"
  45. 0AF0: 13@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID3"
  46. 0AF0: 14@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID4"
  47. 0AF0: 15@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID5"
  48. 0AF0: 16@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID6"
  49. 0AF0: 17@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID7"
  50. 0AF0: 18@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID8"
  51. 0AF0: 19@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID9"
  52. 0AF0: 20@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID10"
  53.  
  54. 0AF2: 3@ = get_float_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "DistanceLimit"
  55. 0AF2: 4@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "FriendlyFire"
  56. 0AF2: 21@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "PlayerIndicator"
  57. else
  58. 0ACA: show_text_box "Player 2 - Drop In, Drop Out!.ini file not found"
  59. 0A93: end_custom_thread
  60. end
  61.  
  62. :CHEATCODE
  63. wait 0
  64. if player.Controllable($PLAYER_CHAR)
  65. jf @CHEATCODE
  66.  
  67. if 1@ == 1
  68. then
  69. if or
  70. 0ADC: test_cheat 0@v
  71. 00E1: player 1 pressed_key 12
  72. then
  73. while 00E1: player 1 pressed_key 12
  74. wait 0
  75. end
  76. jump @INIT
  77. end
  78. else
  79. if
  80. 0ADC: test_cheat 0@v
  81. then
  82. jump @INIT
  83. end
  84. end
  85. jf @CHEATCODE
  86.  
  87. //---------- DROP IN ---------------
  88. :INIT
  89. 0ACA: show_text_box "Player 2 - Drop In!"
  90. //Prevent the 2p game from ending
  91. 0A8C: write_memory 0x442B5C size 1 value 0x90 virtual_protect 1
  92. 0A8C: write_memory 0x442B5D size 1 value 0x90 virtual_protect 1
  93. 0A8C: write_memory 0x442B5E size 1 value 0x90 virtual_protect 1
  94. //Remove the shitty message
  95. 0A8C: write_memory 0x859894 size 1 value 0x90 virtual_protect 1
  96. 0A8C: write_memory 0x859895 size 1 value 0x90 virtual_protect 1
  97. 0A8C: write_memory 0x859896 size 1 value 0x90 virtual_protect 1
  98. 0A8C: write_memory 0x859897 size 1 value 0x90 virtual_protect 1
  99. 0A8C: write_memory 0x859898 size 1 value 0x90 virtual_protect 1
  100. 0A8C: write_memory 0x859899 size 1 value 0x90 virtual_protect 1
  101.  
  102. 04C4: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_actor $PLAYER_ACTOR with_offset -1.5 0.0 1.0
  103. $SECOND_PLAYER = Player.Create (1, $TEMPVAR_FLOAT_1, $TEMPVAR_FLOAT_2, $TEMPVAR_FLOAT_3)
  104. $SECOND_PLAYER_ACTOR = Actor.EmulateFromPlayer($SECOND_PLAYER)
  105. 2@=actor.Angle($PLAYER_ACTOR)
  106. actor.Angle($SECOND_PLAYER_ACTOR)=2@
  107.  
  108. //----- Random Player 2 Skin ----------
  109. 0209: 10@ = random_int_in_ranges 1 11
  110. if 10@==1 //ID1
  111. then
  112. 0085: 10@ = 11@
  113. jump @LOAD_MODEL
  114. end
  115. if 10@==2 //ID2
  116. then
  117. 0085: 10@ = 12@
  118. jump @LOAD_MODEL
  119. end
  120. if 10@==3 //ID3
  121. then
  122. 0085: 10@ = 13@
  123. jump @LOAD_MODEL
  124. end
  125. if 10@==4 //ID4
  126. then
  127. 0085: 10@ = 14@
  128. jump @LOAD_MODEL
  129. end
  130. if 10@==5 //ID5
  131. then
  132. 0085: 10@ = 15@
  133. jump @LOAD_MODEL
  134. end
  135. if 10@==6 //ID6
  136. then
  137. 0085: 10@ = 16@
  138. jump @LOAD_MODEL
  139. end
  140. if 10@==7 //ID7
  141. then
  142. 0085: 10@ = 17@
  143. jump @LOAD_MODEL
  144. end
  145. if 10@==8 //ID8
  146. then
  147. 0085: 10@ = 18@
  148. jump @LOAD_MODEL
  149. end
  150. if 10@==9 //ID9
  151. then
  152. 0085: 10@ = 19@
  153. jump @LOAD_MODEL
  154. end
  155. if 10@==10 //ID10
  156. then
  157. 0085: 10@ = 20@
  158. jump @LOAD_MODEL
  159. end
  160. :LOAD_MODEL
  161. Model.Load(10@)
  162. 038B: load_requested_models
  163. 09C7: change_player $SECOND_PLAYER model_to 10@
  164. model.Destroy(10@)
  165.  
  166. //----- Random Fighting Style ----------
  167. 0209: 2@ = random_int_in_ranges 1 5
  168. if 2@==1
  169. then
  170. 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 15 moves 6 //Default
  171. jump @SETTINGS
  172. end
  173. if 2@==2
  174. then
  175. 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 5 moves 6 //LS
  176. jump @SETTINGS
  177. end
  178. if 2@==3
  179. then
  180. 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 6 moves 6 //SF
  181. jump @SETTINGS
  182. end
  183. if 2@==4
  184. then
  185. 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 7 moves 6 //LV
  186. jump @SETTINGS
  187. end
  188.  
  189. //----- Settings ----------
  190. :SETTINGS
  191. 08E7: disable_entrance_markers 1
  192. 09F8: give_player2_weapons_of_player1
  193. 04DD: 2@ = actor $PLAYER_ACTOR armour
  194. 035F: actor $SECOND_PLAYER_ACTOR armour += 2@
  195. 0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 1
  196. 0746: set_acquaintance 1 of_actors_pedtype 8 to_actors_pedtype 1
  197. 06E0: set_2_player_camera_mode_to 4
  198. 094E: set_actor $SECOND_PLAYER_ACTOR mute_pain_audio 0
  199.  
  200. 06F1: set_2_player_distance_limit_to 3@
  201. if
  202. 4@==0
  203. then
  204. 06F3: set_players_can_target_eachother 0
  205. 0568: set_actor $PLAYER_ACTOR untargetable 1 //FRIENDLY FIRE = NO
  206. 0568: set_actor $SECOND_PLAYER_ACTOR untargetable 1
  207. else
  208. 06F3: set_players_can_target_eachother 1
  209. 0568: set_actor $PLAYER_ACTOR untargetable 0 //FRIENDLY FIRE = YES
  210. 0568: set_actor $SECOND_PLAYER_ACTOR untargetable 0
  211. end
  212. 5@=1
  213. wait 250
  214.  
  215. //---------- RUNNING ---------------
  216. :RUNNING
  217. wait 0
  218. if or
  219. 0741: actor $PLAYER_ACTOR busted
  220. 0117: player $PLAYER_CHAR wasted
  221. 0741: actor $SECOND_PLAYER_ACTOR busted
  222. 0117: player $SECOND_PLAYER wasted
  223. then
  224. jump @RESET
  225. end
  226.  
  227. if 1@==1
  228. then
  229. if or
  230. 0ADC: test_cheat 0@v
  231. 00E1: player 1 pressed_key 12
  232. then
  233. while 00E1: player 1 pressed_key 12
  234. wait 0
  235. end
  236. jump @RESET
  237. else
  238. gosub @VEHICLES
  239. gosub @MARKERS
  240. end
  241. else
  242. if
  243. 0ADC: test_cheat 0@v
  244. then
  245. jump @RESET
  246. else
  247. gosub @VEHICLES
  248. gosub @MARKERS
  249. end
  250. end
  251. jump @RUNNING
  252.  
  253. :VEHICLES
  254. //----- Dynamic separate vehicle detector ----------
  255. if or
  256. 00F2: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0
  257. 00F2: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0
  258.  
  259. 00F4: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0 in_car
  260. 00F4: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0 in_car
  261.  
  262. 00F3: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0 on_foot
  263. 00F3: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0 on_foot
  264. then
  265. 06FA: allow_players_to_use_separate_vehicles 0
  266. else
  267. 06FA: allow_players_to_use_separate_vehicles 1
  268. end
  269.  
  270. //----- Separate cars camera / Disappear marker in same car ----------
  271. 03C0: 8@ = actor $PLAYER_ACTOR car
  272. 03C0: 9@ = actor $SECOND_PLAYER_ACTOR car
  273. if and
  274. 00DF: actor $PLAYER_ACTOR driving
  275. 0449: actor $PLAYER_ACTOR in_a_car
  276. 00DF: actor $SECOND_PLAYER_ACTOR driving
  277. 0449: actor $SECOND_PLAYER_ACTOR in_a_car
  278. then
  279. if 003B: 8@ == 9@
  280. then
  281. 0164: disable_marker 7@
  282. 0164: disable_marker 6@
  283. 015A: restore_camera
  284. 5@=1
  285. return
  286. else
  287. 0158: camera_on_car 8@ mode 48 switchstyle 2
  288. return
  289. end
  290. end
  291. return
  292.  
  293. :MARKERS
  294. //----- Marker in radar/world ----------
  295. if 5@ == 1
  296. then
  297. if 21@ == 0
  298. then
  299. 0187: 7@ = create_marker_above_actor $SECOND_PLAYER_ACTOR
  300. 07E0: set_marker 7@ type_to 1
  301. 018B: set_marker 7@ radar_mode 2
  302. 5@ = 0
  303. else
  304. 0187: 7@ = create_marker_above_actor $SECOND_PLAYER_ACTOR
  305. 07E0: set_marker 7@ type_to 1
  306. 018B: set_marker 7@ radar_mode 3
  307. 0187: 6@ = create_marker_above_actor $PLAYER_ACTOR
  308. 018B: set_marker 6@ radar_mode 1
  309. 5@ = 0
  310. end
  311. end
  312. return
  313.  
  314. //----- Changing some stuff so gta_sa.exe doesn't shit itself in the pants :) ----------
  315. :RESET
  316. if and
  317. 00DF: actor $PLAYER_ACTOR driving
  318. 0449: actor $PLAYER_ACTOR in_a_car
  319. 00DF: actor $SECOND_PLAYER_ACTOR driving
  320. 0449: actor $SECOND_PLAYER_ACTOR in_a_car
  321. then
  322. if 003B: 8@ == 9@
  323. then
  324. jump @RESET_
  325. else
  326. 015A: restore_camera
  327. jump @RESET_
  328. end
  329. end
  330.  
  331. :RESET_
  332. 0164: disable_marker 6@
  333. //015A: restore_camera
  334. 0687: clear_actor $PLAYER_ACTOR task
  335. 08E7: disable_entrance_markers 0
  336. 06DF: destroy_player $SECOND_PLAYER
  337. 0ACA: show_text_box "Player 2 - Drop Out!"
  338. wait 500
  339. jump @CHEATCODE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement