Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$CLEO}
- {---------- PLAYER 2 - DROP IN, DROP OUT! --------------------
- Autor: rerun_aaap
- Credits to: 1.Nights744, for implementing the 2-Player mode in PC through CLEO scripts
- 2.Marsi4eg, for the features added in his mod 2-Player Mode Enhancements
- 3.skatefilter5, for the idea of having the second player spawn out of nothing
- And the whole GTAForums community, learned a lot of CLEO scripting there :)
- This script is basically a mix of the other three scripts,
- putted together in a way that made the concept of 2-player mode more fast, more fun,
- with more features and easier to understand for new players
- Variables used:
- 0@v (.ini)CheatCode
- 1@ (.ini)Player2PressStart
- 2@ Actor Angle/Random Fighting Style/Player 2 Armor
- 3@ (.ini)Distance Limit
- 4@ (.ini)Friendly Fire
- 5@ "Player Markers" Switch
- 6@ Player 1 Marker
- 7@ Player 2 Marker
- 8@ Player 1 Car
- 9@ Player 2 Car
- 10@ Random Player 2 Skin
- 11@ (.ini)ID1
- 12@ (.ini)ID2
- 13@ (.ini)ID3
- 14@ (.ini)ID4
- 15@ (.ini)ID5
- 16@ (.ini)ID6
- 17@ (.ini)ID7
- 18@ (.ini)ID8
- 19@ (.ini)ID9
- 20@ (.ini)ID10
- 21@ (.ini)PlayerIndicator
- }
- if
- 0AAB: file_exists "cleo\Player 2 - Drop In, Drop Out!.ini"
- then
- 0AF4: 0@v = read_string_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "Activation" key "CheatCode"
- 0AF0: 1@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "Activation" key "Player2PressStart"
- 0AF0: 11@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID1"
- 0AF0: 12@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID2"
- 0AF0: 13@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID3"
- 0AF0: 14@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID4"
- 0AF0: 15@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID5"
- 0AF0: 16@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDs" key "ID6"
- 0AF0: 17@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID7"
- 0AF0: 18@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID8"
- 0AF0: 19@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID9"
- 0AF0: 20@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "IDS" key "ID10"
- 0AF2: 3@ = get_float_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "DistanceLimit"
- 0AF2: 4@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "FriendlyFire"
- 0AF2: 21@ = get_int_from_ini_file "cleo\Player 2 - Drop In, Drop Out!.ini" section "GameplayOptions" key "PlayerIndicator"
- else
- 0ACA: show_text_box "Player 2 - Drop In, Drop Out!.ini file not found"
- 0A93: end_custom_thread
- end
- :CHEATCODE
- wait 0
- if player.Controllable($PLAYER_CHAR)
- jf @CHEATCODE
- if 1@ == 1
- then
- if or
- 0ADC: test_cheat 0@v
- 00E1: player 1 pressed_key 12
- then
- while 00E1: player 1 pressed_key 12
- wait 0
- end
- jump @INIT
- end
- else
- if
- 0ADC: test_cheat 0@v
- then
- jump @INIT
- end
- end
- jf @CHEATCODE
- //---------- DROP IN ---------------
- :INIT
- 0ACA: show_text_box "Player 2 - Drop In!"
- //Prevent the 2p game from ending
- 0A8C: write_memory 0x442B5C size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x442B5D size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x442B5E size 1 value 0x90 virtual_protect 1
- //Remove the shitty message
- 0A8C: write_memory 0x859894 size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x859895 size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x859896 size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x859897 size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x859898 size 1 value 0x90 virtual_protect 1
- 0A8C: write_memory 0x859899 size 1 value 0x90 virtual_protect 1
- 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
- $SECOND_PLAYER = Player.Create (1, $TEMPVAR_FLOAT_1, $TEMPVAR_FLOAT_2, $TEMPVAR_FLOAT_3)
- $SECOND_PLAYER_ACTOR = Actor.EmulateFromPlayer($SECOND_PLAYER)
- 2@=actor.Angle($PLAYER_ACTOR)
- actor.Angle($SECOND_PLAYER_ACTOR)=2@
- //----- Random Player 2 Skin ----------
- 0209: 10@ = random_int_in_ranges 1 11
- if 10@==1 //ID1
- then
- 0085: 10@ = 11@
- jump @LOAD_MODEL
- end
- if 10@==2 //ID2
- then
- 0085: 10@ = 12@
- jump @LOAD_MODEL
- end
- if 10@==3 //ID3
- then
- 0085: 10@ = 13@
- jump @LOAD_MODEL
- end
- if 10@==4 //ID4
- then
- 0085: 10@ = 14@
- jump @LOAD_MODEL
- end
- if 10@==5 //ID5
- then
- 0085: 10@ = 15@
- jump @LOAD_MODEL
- end
- if 10@==6 //ID6
- then
- 0085: 10@ = 16@
- jump @LOAD_MODEL
- end
- if 10@==7 //ID7
- then
- 0085: 10@ = 17@
- jump @LOAD_MODEL
- end
- if 10@==8 //ID8
- then
- 0085: 10@ = 18@
- jump @LOAD_MODEL
- end
- if 10@==9 //ID9
- then
- 0085: 10@ = 19@
- jump @LOAD_MODEL
- end
- if 10@==10 //ID10
- then
- 0085: 10@ = 20@
- jump @LOAD_MODEL
- end
- :LOAD_MODEL
- Model.Load(10@)
- 038B: load_requested_models
- 09C7: change_player $SECOND_PLAYER model_to 10@
- model.Destroy(10@)
- //----- Random Fighting Style ----------
- 0209: 2@ = random_int_in_ranges 1 5
- if 2@==1
- then
- 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 15 moves 6 //Default
- jump @SETTINGS
- end
- if 2@==2
- then
- 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 5 moves 6 //LS
- jump @SETTINGS
- end
- if 2@==3
- then
- 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 6 moves 6 //SF
- jump @SETTINGS
- end
- if 2@==4
- then
- 07FE: set_actor $SECOND_PLAYER_ACTOR fighting_style_to 7 moves 6 //LV
- jump @SETTINGS
- end
- //----- Settings ----------
- :SETTINGS
- 08E7: disable_entrance_markers 1
- 09F8: give_player2_weapons_of_player1
- 04DD: 2@ = actor $PLAYER_ACTOR armour
- 035F: actor $SECOND_PLAYER_ACTOR armour += 2@
- 0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 1
- 0746: set_acquaintance 1 of_actors_pedtype 8 to_actors_pedtype 1
- 06E0: set_2_player_camera_mode_to 4
- 094E: set_actor $SECOND_PLAYER_ACTOR mute_pain_audio 0
- 06F1: set_2_player_distance_limit_to 3@
- if
- 4@==0
- then
- 06F3: set_players_can_target_eachother 0
- 0568: set_actor $PLAYER_ACTOR untargetable 1 //FRIENDLY FIRE = NO
- 0568: set_actor $SECOND_PLAYER_ACTOR untargetable 1
- else
- 06F3: set_players_can_target_eachother 1
- 0568: set_actor $PLAYER_ACTOR untargetable 0 //FRIENDLY FIRE = YES
- 0568: set_actor $SECOND_PLAYER_ACTOR untargetable 0
- end
- 5@=1
- wait 250
- //---------- RUNNING ---------------
- :RUNNING
- wait 0
- if or
- 0741: actor $PLAYER_ACTOR busted
- 0117: player $PLAYER_CHAR wasted
- 0741: actor $SECOND_PLAYER_ACTOR busted
- 0117: player $SECOND_PLAYER wasted
- then
- jump @RESET
- end
- if 1@==1
- then
- if or
- 0ADC: test_cheat 0@v
- 00E1: player 1 pressed_key 12
- then
- while 00E1: player 1 pressed_key 12
- wait 0
- end
- jump @RESET
- else
- gosub @VEHICLES
- gosub @MARKERS
- end
- else
- if
- 0ADC: test_cheat 0@v
- then
- jump @RESET
- else
- gosub @VEHICLES
- gosub @MARKERS
- end
- end
- jump @RUNNING
- :VEHICLES
- //----- Dynamic separate vehicle detector ----------
- if or
- 00F2: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0
- 00F2: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0
- 00F4: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0 in_car
- 00F4: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0 in_car
- 00F3: actor $SECOND_PLAYER_ACTOR near_actor $PLAYER_ACTOR radius 5.0 5.0 sphere 0 on_foot
- 00F3: actor $PLAYER_ACTOR near_actor $SECOND_PLAYER_ACTOR radius 5.0 5.0 sphere 0 on_foot
- then
- 06FA: allow_players_to_use_separate_vehicles 0
- else
- 06FA: allow_players_to_use_separate_vehicles 1
- end
- //----- Separate cars camera / Disappear marker in same car ----------
- 03C0: 8@ = actor $PLAYER_ACTOR car
- 03C0: 9@ = actor $SECOND_PLAYER_ACTOR car
- if and
- 00DF: actor $PLAYER_ACTOR driving
- 0449: actor $PLAYER_ACTOR in_a_car
- 00DF: actor $SECOND_PLAYER_ACTOR driving
- 0449: actor $SECOND_PLAYER_ACTOR in_a_car
- then
- if 003B: 8@ == 9@
- then
- 0164: disable_marker 7@
- 0164: disable_marker 6@
- 015A: restore_camera
- 5@=1
- return
- else
- 0158: camera_on_car 8@ mode 48 switchstyle 2
- return
- end
- end
- return
- :MARKERS
- //----- Marker in radar/world ----------
- if 5@ == 1
- then
- if 21@ == 0
- then
- 0187: 7@ = create_marker_above_actor $SECOND_PLAYER_ACTOR
- 07E0: set_marker 7@ type_to 1
- 018B: set_marker 7@ radar_mode 2
- 5@ = 0
- else
- 0187: 7@ = create_marker_above_actor $SECOND_PLAYER_ACTOR
- 07E0: set_marker 7@ type_to 1
- 018B: set_marker 7@ radar_mode 3
- 0187: 6@ = create_marker_above_actor $PLAYER_ACTOR
- 018B: set_marker 6@ radar_mode 1
- 5@ = 0
- end
- end
- return
- //----- Changing some stuff so gta_sa.exe doesn't shit itself in the pants :) ----------
- :RESET
- if and
- 00DF: actor $PLAYER_ACTOR driving
- 0449: actor $PLAYER_ACTOR in_a_car
- 00DF: actor $SECOND_PLAYER_ACTOR driving
- 0449: actor $SECOND_PLAYER_ACTOR in_a_car
- then
- if 003B: 8@ == 9@
- then
- jump @RESET_
- else
- 015A: restore_camera
- jump @RESET_
- end
- end
- :RESET_
- 0164: disable_marker 6@
- //015A: restore_camera
- 0687: clear_actor $PLAYER_ACTOR task
- 08E7: disable_entrance_markers 0
- 06DF: destroy_player $SECOND_PLAYER
- 0ACA: show_text_box "Player 2 - Drop Out!"
- wait 500
- jump @CHEATCODE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement