Matheus Reis Posted August 24, 2010 Share Posted August 24, 2010 Hi, I've created a MPACK with a little mission, in that, an actor spawn as friend, and you two have to kill 3 random actors on the given range, when I kill them, I earn $2000, but when I die I earn it too, look at the code. DEFINE MISSIONS 1DEFINE MISSION 0 AT @MTHDEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA script//DEFINE SCRIPT {NAME} AT {LABEL} @DEFINE UNKNOWN_EMPTY_SEGMENT 0DEFINE UNKNOWN_THREADS_MEMORY 0{$VERSION 3.0.0000}var$PLAYER_CHAR: Playerend // var 03A4: name_thread 'MAIN' 01F0: set_max_wanted_level_to 6 0111: toggle_wasted_busted_check 0 00C0: set_current_time_hours_to 22 minutes_to 0 04E4: unknown_refresh_game_renderer_at 1639.0149 2082.865203CB: set_rendering_origin_at 1639.0149 2082.8652 11.3125 0053: $PLAYER_CHAR = create_player #NULL at 1639.0149 2082.8652 11.3125 01F5: $PLAYER_ACTOR = create_player_actor $PLAYER_CHAR 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 01B6: set_weather 0 0001: wait 0 ms 087B: set_player $PLAYER_CHAR clothes_texture "PLAYER_FACE" model "HEAD" body_part 1 087B: set_player $PLAYER_CHAR clothes_texture "TRACKTRBLUSTR" model "TRACKTR" body_part 2 087B: set_player $PLAYER_CHAR clothes_texture "FLIPFLOP" model "FLIPFLOP" body_part 3 087B: set_player $PLAYER_CHAR clothes_texture "BASKBALLRIM" model "BASKBALL" body_part 0 070D: rebuild_player $PLAYER_CHAR 01B4: toggle_player $PLAYER_CHAR can_move 1 016A: fade 1 time 2500 04BB: select_interior 0 0629: change_integer_stat 181 to 4 016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0 016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 0180: set_on_mission_flag_to $ONMISSION 0004: $DEFAULT_WAIT_TIME = 25003E6: remove_text_box // put your create_thread commands here0213: $My_Save = create_pickup #PICKUPSAVE type 15 at 1639.7744 2075.7441 11.3125 0570: $Marker_Save = create_asset_radar_marker_with_icon 35 at 1639.7744 2075.7441 11.31250213: $My_Gun = create_pickup #DESERT_EAGLE type 15 at 508.0762 -71.8294 998.7578 02A7: $Marker_Mission = create_icon_marker_and_sphere 47 at 1602.2667 2130.0823 11.3147$ONMISSION = 0:MAIN_LOOP0001: wait $DEFAULT_WAIT_TIME ms00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes00D6: if 0214: pickup $My_Save picked_up 004D: jump_if_false @MAIN_SAVE_END03D8: show_save_screen :MY_SAVE_CHECK0001: wait 0 ms 00D6: if 83D9: not save_done 004D: jump_if_false @MAIN_SAVE_END0002: jump @MY_SAVE_CHECK:MAIN_SAVE_END00D6: if 0214: pickup $My_Gun picked_up 004D: jump_if_false @MAIN_GUN_END0247: load_model #DESERT_EAGLE038B: load_requested_models :MY_GUN_CHECK0001: wait 0 ms 00D6: if 0248: model #DESERT_EAGLE available 004D: jump_if_false @MY_GUN_CHECK01B2: give_actor $PLAYER_ACTOR weapon 24 ammo 85 :MAIN_GUN_END:MissionTrigger0001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @MissionTriggerEnd00D6: if0038: $ONMISSION == 0004D: jump_if_false @MissionTriggerEnd00D6: if00ED: actor $PLAYER_ACTOR 0 near_point 1602.2667 2130.0823 radius 1.0 1.0 on_foot 004D: jump_if_false @MissionTriggerEnd0417: start_mission 00004: $ONMISSION = 1:MissionTriggerEnd0002: jump @MissionTrigger0002: jump @MAIN_LOOP :MTH03A4: name_thread 'MTH'0050: gosub @MissionBeginif or0112: wasted_or_busted0118: actor $Johnny dead004D: jump_if_false @MissionEnd0050: gosub @MissionFailed:MissionEnd0050: gosub @MissionCleanup004E: end_thread:MissionBegin// This section is where you place the contents of your mission01B4: set_player $PLAYER_CHAR can_move 009D4: suspend_wanted_level fade 0 500wait 100000BA: show_text_styled GXT 'MNAME_1' time 1000 style 2 // M.T.H.wait 1000fade 1 50001B4: set_player $PLAYER_CHAR can_move 1Model.Load(#MALE01)038B: load_requested_models009A: $Johnny = create_actor_pedtype 4 model #MALE01 at 1607.9613 2130.1692 10.862702E2: set_actor $Johnny weapon_accuracy_to 75 0631: put_actor $Johnny in_group $PLAYER_GROUP wait 50000BB: show_text_lowpriority GXT 'MTLK_1' time 1000 flag 1wait 100000BB: show_text_lowpriority GXT 'MTLK_2' time 1000 flag 104C4: store_coords_to $Coord_X $Coord_Y $Coord_Z from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 08E5: get_actor_in_sphere $Coord_X $Coord_Y $Coord_Z radius 200.0 handle_as $Target_A08E5: get_actor_in_sphere $Coord_X $Coord_Y $Coord_Z radius 200.0 handle_as $Target_B08E5: get_actor_in_sphere $Coord_X $Coord_Y $Coord_Z radius 200.0 handle_as $Target_C0187: 0@ = create_marker_above_actor $Target_A 0187: 1@ = create_marker_above_actor $Target_B 0187: 2@ = create_marker_above_actor $Target_C 0187: 3@ = create_marker_above_actor $Johnny0165: set_marker 3@ color_to 1 Model.Load(#COLT45)Model.Load(#BAT)Model.Load(#M4)038B: load_requested_models 01B2: give_actor $Target_A weapon 5 ammo 60 01B2: give_actor $Target_B weapon 31 ammo 6001B2: give_actor $Target_C weapon 31 ammo 6001B2: give_actor $PLAYER_ACTOR weapon 5 ammo 6001B2: give_actor $Johnny weapon 5 ammo 60:loopwait 0if and0118: actor $Target_A dead0118: actor $Target_B dead0118: actor $Target_C deadjf @loopjump @MissionCleanup0051: return:MissionFailed00BA: show_text_styled GXT 'M_FAIL' time 2000 style 1 0004: $ONMISSION = 0wait 10000051: return:MissionCleanup01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1 0109: player $PLAYER_CHAR money += 2000 0004: $ONMISSION = 00164: disable_marker $Marker_Mission00D8: mission_cleanup0051: return Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/ Share on other sites More sharing options...
Jerry123 Posted August 24, 2010 Share Posted August 24, 2010 The Money code is in the Cleanup Part. You have to write the code in the passed section :loopwait 0if and0118: actor $Target_A dead0118: actor $Target_B dead0118: actor $Target_C deadjf @loopgosub @MissionPassed0051: return:MissionPassedwait 50001E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 10109: player $PLAYER_CHAR money += 2000return:MissionFailed00BA: show_text_styled GXT 'M_FAIL' time 2000 style 10004: $ONMISSION = 0wait 10000051: return:MissionCleanup0004: $ONMISSION = 00164: disable_marker $Marker_Mission00D8: mission_cleanup0051: return Hope this works Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/#findComment-1060097062 Share on other sites More sharing options...
Matheus Reis Posted August 24, 2010 Author Share Posted August 24, 2010 Well, it's working, thank you. But I have another question: The things that have to occur when I pass is alright, but when I fail, the Mission Marker disappear too and I can't do it again, help! Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/#findComment-1060097465 Share on other sites More sharing options...
ZAZ Posted August 25, 2010 Share Posted August 25, 2010 (edited) Well, it's working, thank you. But I have another question: The things that have to occur when I pass is alright, but when I fail, the Mission Marker disappear too and I can't do it again, help! then don't delete the marker and make the visible sphere in the mission trigger 00ED: actor $PLAYER_ACTOR 1 <--- Edited August 25, 2010 by ZAZ Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/#findComment-1060098508 Share on other sites More sharing options...
yair1221 Posted August 25, 2010 Share Posted August 25, 2010 because of this :MissionEnd0050: gosub @MissionCleanup004E: end_thread try doing this instead :MissionEnd0050: gosub @MissionCleanupjump @MissionTrigger Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/#findComment-1060098544 Share on other sites More sharing options...
ZAZ Posted August 25, 2010 Share Posted August 25, 2010 because of this :MissionEnd0050: gosub @MissionCleanup004E: end_thread try doing this instead :MissionEnd0050: gosub @MissionCleanupjump @MissionTrigger Bullsh*t Link to comment https://gtaforums.com/topic/457648-mission-coding-on-stripped-main/#findComment-1060098563 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now