Jump to content

Why My Mission crash if mission failed?


Gian_Yagami

Recommended Posts

Gian_Yagami

sorry trouble, could you check this?

 

Why My Mission crash if mission failed

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on {$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP 0@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471):NONAME_24wait 0 0102:   actor $PLAYER_ACTOR in_sphere 2536.422 -1694.349 13.6471 radius 1.6 1.6 1.6 sphere 0 stopped_on_foot jf @NONAME_24 023C: load_special_actor 'FAIZ555' as 1 // models 290-299 Model.Load(#NRG500)Model.Load(#BALLAS1)Model.Load(#BALLAS2)Model.Load(#BALLAS3)023C: load_special_actor 'DECADE' as 2 // models 290-299 Model.Load(#MP5LNG)Model.Load(#DESERT_EAGLE)Model.Load(#KATANA)038B: load_requested_models 04ED: load_animation "GANGS" Marker.Disable(0@)$ONMISSION = 1 02A3: enable_widescreen 1 Camera.SetPosition(2525.352, -1704.289, 23.3828, 0.0, 0.0, 0.0)Camera.PointAt(2525.238, -1717.788, 23.5119, 2)00BA: show_text_styled GXT 'KRIDE' time 1000 style 2 wait 3000 :NONAME_229wait 0 if and  Model.Available(#NRG500)  Model.Available(#BALLAS1)  Model.Available(#BALLAS2)  Model.Available(#BALLAS3)  Model.Available(#MP5LNG)  Model.Available(#MP5LNG)  Model.Available(#DESERT_EAGLE)023D:   special_actor 1 loaded 023D:   special_actor 2 loaded jf @NONAME_229 :NONAME_284wait 0 if 04EE:   animation "GANGS" loaded jf @NONAME_284 1@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528)Actor.Angle(1@) = 92.0506Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463)Actor.Angle($PLAYER_ACTOR) = 267.9048Player.CanMove($PLAYER_CHAR) = False02A3: enable_widescreen 1 Camera.SetPosition(2533.352, -1704.289, 13.3828, 0.0, 0.0, 0.0)Camera.PointAt(2533.238, -1717.788, 13.5119, 2)0605: actor 1@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 00BC: show_text_highpriority GXT 'HCISI' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'BCWAT' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'HWTGB' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'TMFO' time 3000 flag 0 wait 2000 Camera.Restore_WithJumpCut02A3: enable_widescreen 0 0687: clear_actor 1@ task 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 0631: put_actor 1@ in_group $PLAYER_GROUP 01B2: give_actor 1@ weapon 24 ammo 10 // Load the weapon model before using this 01B9: set_actor 1@ armed_weapon_to 8 081A: set_actor 1@ weapon_skill_to 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 087E: set_actor 1@ weapon_droppable 1 Actor.Armour(1@) = 150Actor.Health(1@) = 100Player.CanMove($PLAYER_CHAR) = True20@ = Pickup.Create(1242, 3, 2533.86, -1692.545, 13.684)21@ = Pickup.Create(1240, 3, 2531.971, -1691.268, 13.7228)2@ = Car.Create(#NRG500, 2509.176, -1671.266, 13.0802)Car.Angle(2@) = 349.4163@ = Marker.CreateAboveCar(2@)Marker.SetColor(3@, 1)00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0    :NONAME_782wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFALED if   Actor.InCar($PLAYER_ACTOR, 2@)jf @NONAME_782 00BC: show_text_highpriority GXT 'GTBSD' time 3000 flag 0 Marker.Disable(3@)018A: 3@ = create_checkpoint_at 2580.396 -2113.083 1.2353 03BC: 4@ = create_sphere_at 2580.396 -2113.083 1.2353 radius 3.0 :NONAME_892wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFALED if 0103:   actor $PLAYER_ACTOR in_sphere 2580.396 -2113.083 1.2353 radius 3.0 3.0 3.0 sphere 0 stopped_in_car jf @NONAME_892 Marker.Disable(3@)03BD: destroy_sphere 4@ Player.CanMove($PLAYER_CHAR) = False02A3: enable_widescreen 1 Camera.SetPosition(2571.298, -2131.141, 0.2417, 0.0, 0.0, 0.0)Camera.PointAt(2553.847, -2131.96, 0.1888, 2)5@ = Actor.Create(CivMale, #SPECIAL02, 2559.72, -2135.74, -0.0114)Actor.Angle(5@) = 357.24686@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261)Actor.Angle(6@) = 183.65857@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599)Actor.Angle(7@) = 267.31928@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276)Actor.Angle(8@) = 271.006701B2: give_actor 6@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 7@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 8@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 5@ weapon 24 ammo 10 // Load the weapon model before using this 01B2: give_actor 5@ weapon 8 ammo 1 // Load the weapon model before using this Actor.Armour(5@) = 1000687: clear_actor 5@ task 0687: clear_actor 6@ task Actor.Health(5@) = 20001B9: set_actor 5@ armed_weapon_to 8 01B9: set_actor 6@ armed_weapon_to 29 01B9: set_actor 7@ armed_weapon_to 29 01B9: set_actor 8@ armed_weapon_to 29 081A: set_actor 5@ weapon_skill_to 0 0946: set_actor 5@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 6@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 7@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 8@ actions_uninterupted_by_weapon_fire 1 087E: set_actor 5@ weapon_droppable 1 087E: set_actor 6@ weapon_droppable 1 087E: set_actor 7@ weapon_droppable 1 087E: set_actor 8@ weapon_droppable 1 0633: AS_actor $PLAYER_ACTOR exit_car 0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKD" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0632: release_group $PLAYER_GROUP 00BC: show_text_highpriority GXT 'IGIT' time 3000 flag 0 wait 2000 Player.CanMove($PLAYER_CHAR) = True02A3: enable_widescreen 0 Camera.Restore_WithJumpCut0633: AS_actor 1@ exit_car 05E2: AS_actor 1@ kill_actor 5@ 0630: put_actor 5@ in_group 9@ as_leader 0631: put_actor 6@ in_group 9@ 0631: put_actor 7@ in_group 9@ 0631: put_actor 8@ in_group 9@ 05E2: AS_actor 5@ kill_actor 1@ 05E2: AS_actor 6@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 7@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 8@ kill_actor $PLAYER_ACTOR 10@ = Marker.CreateAboveActor(5@)11@ = Marker.CreateAboveActor(6@)12@ = Marker.CreateAboveActor(7@)13@ = Marker.CreateAboveActor(8@)Marker.SetColor(10@, 0)Marker.SetColor(11@, 1073774847)Marker.SetColor(12@, 1073774847)Marker.SetColor(13@, 1073774847):NONAME_1614wait 0 if or   not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFALED if and  Actor.Dead(5@)  Actor.Dead(6@)  Actor.Dead(7@)  Actor.Dead(8@)jf @NONAME_1614 Marker.Disable(10@)Marker.Disable(11@)Marker.Disable(12@)Marker.Disable(13@)Actor.StorePos(5@, 14@, 15@, 16@)17@ = Pickup.Create(1254, 3, 14@, 15@, 16@)04C4: store_coords_to 30@ 31@ 32@ from_actor 5@ with_offset 0.0 -3.0 0.0 Camera.SetPosition(30@, 31@, 32@, 0.0, 0.0, 0.0)Camera.PointAt(14@, 15@, 16@, 2)0512: show_permanent_text_box 'CHBH' 03DC: 25@ = create_marker_above_pickup 17@ Marker.SetColor(25@, 0)wait 2000 Camera.Restore_WithJumpCut:NONAME_1819wait 0 if or                                                            not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFALED if  Pickup.Picked_up(17@)jf @NONAME_1819 03E6: remove_text_box Pickup.Destroy(17@)Pickup.Destroy(20@)Pickup.Destroy(21@)0394: play_music 1 01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~Player.Money($PLAYER_CHAR) += 2000 $ONMISSION == 0 Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)04EF: release_animation "GANGS" Marker.Disable(-2):MISSIONFALED00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!$ONMISSION == 0 Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)04EF: release_animation "GANGS" Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)

 

 

and Icon 17@ not avaible after Camera.Restore_WithJumpCut. how to fix it?

Link to comment
Share on other sites

Your mission has no end.

 

@Joni2030 This isn't a proper mission, there is no cm file and no sniffer thread.

Link to comment
Share on other sites

Gian_Yagami

Sorry late relpy.

 

so? how? confused.gif please...

what cleo mission must be in cm format

yeah, I think cm=Cleo Mission. that's true?

Edited by Gian_Yagami
Link to comment
Share on other sites

Ashwin.Star

 

0AA0: gosub_if_false @MISSIONFALED 

 

use "jf" instead, otherwise put "return" at the END of script,

Link to comment
Share on other sites

Besides, use the end_custom_script code at the end. But then you can't replay the mission. You should try to make a proper mission. You can use the tutorial of ZAZ.

Link to comment
Share on other sites

Gian_Yagami

and this?

 

Icon 17@ not avaible after Camera.Restore_WithJumpCut. how to fix it?
Link to comment
Share on other sites

Do you mean pickup 17@, or marker 25@?

 

Is the camera in the right position in your script? Because you used a timer (32@) as a coord (after you created the pickup).

 

04C4: store_coords_to 30@ 31@ 32@ from_actor 5@ with_offset 0.0 -3.0 0.0Camera.SetPosition(30@, 31@, 32@, 0.0, 0.0, 0.0)

 

Link to comment
Share on other sites

Gian_Yagami

so what should I change to fix icon 17@?

 

& why first and second parameter not work?

 

 

:NONAME_782wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED

 

 

if

Actor.InCar($PLAYER_ACTOR, 2@)

jf @NONAME_782

00BC: show_text_highpriority GXT 'GTBSD' time 3000 flag 0

Marker.Disable(3@)

018A: 3@ = create_checkpoint_at 2580.396 -2113.083 1.2353

03BC: 4@ = create_sphere_at 2580.396 -2113.083 1.2353 radius 3.0

 

:NONAME_892wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED 

 

 

I kill Actor 1 after this code for cutscene:

 

 

02A3: enable_widescreen 1 Camera.SetPosition(2533.352, -1704.289, 13.3828, 0.0, 0.0, 0.0)Camera.PointAt(2533.238, -1717.788, 13.5119, 2)0605: actor 1@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 00BC: show_text_highpriority GXT 'HCISI' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'BCWAT' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'HWTGB' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'TMFO' time 3000 flag 0 wait 2000 Camera.Restore_WithJumpCut02A3: enable_widescreen 0 0687: clear_actor 1@ task 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 0631: put_actor 1@ in_group $PLAYER_GROUP 01B2: give_actor 1@ weapon 24 ammo 10 // Load the weapon model before using this 01B9: set_actor 1@ armed_weapon_to 8 081A: set_actor 1@ weapon_skill_to 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 087E: set_actor 1@ weapon_droppable 1 Actor.Armour(1@) = 150Actor.Health(1@) = 100Player.CanMove($PLAYER_CHAR) = True20@ = Pickup.Create(1242, 3, 2533.86, -1692.545, 13.684)21@ = Pickup.Create(1240, 3, 2531.971, -1691.268, 13.7228)2@ = Car.Create(#NRG500, 2509.176, -1671.266, 13.0802)Car.Angle(2@) = 349.4163@ = Marker.CreateAboveCar(2@)Marker.SetColor(3@, 1)00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0

 

 

and mission failed text appears after CJ go to chekpoint

 

 

018A: 3@ = create_checkpoint_at 2580.396 -2113.083 1.2353 03BC: 4@ = create_sphere_at 2580.396 -2113.083 1.2353 radius 3.0
 
Link to comment
Share on other sites

Maybe try to use an other local because you use 3@ again when you have just disabled it. Also, if you succeed your mission, you jump automatically to the mission fail part. And could you post your full updated script?

 

If you can, you should try to put your mission in this format (needs a sniffer thread):

 

{$CLEO .cm}:MyMission thread "MyMission" gosub @MissionStart if  wasted_or_busted then  gosub @MissionFailed end gosub @MissionCleanup end_thread :MissionStart gosub @MissionPassed return :MissionPassedwait 500 01E3: text_1number_styled 'M_PASSD' 0 5000 ms 1 // MISSION PASSED! return :MissionFailed 00BA: text_styled 'M_FAIL' 5000 ms 1 // ~r~MISSION FAILED! return :MissionCleanup $ONMISSION = 0 // integer values mission_cleanup return 

 

Link to comment
Share on other sites

Gian_Yagami

sure smile.gif this my script:

 

 

{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP 0@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471):NONAME_24wait 0 0102:   actor $PLAYER_ACTOR in_sphere 2536.422 -1694.349 13.6471 radius 1.6 1.6 1.6 sphere 0 stopped_on_foot jf @NONAME_24 023C: load_special_actor 'FAIZ555' as 1 // models 290-299 Model.Load(#NRG500)Model.Load(#BALLAS1)Model.Load(#BALLAS2)Model.Load(#BALLAS3)023C: load_special_actor 'DECADE' as 2 // models 290-299 Model.Load(#MP5LNG)Model.Load(#DESERT_EAGLE)Model.Load(#KATANA)038B: load_requested_models 04ED: load_animation "GANGS" Marker.Disable(0@)$ONMISSION = 1 02A3: enable_widescreen 1 Camera.SetPosition(2525.352, -1704.289, 23.3828, 0.0, 0.0, 0.0)Camera.PointAt(2525.238, -1717.788, 23.5119, 2)00BA: show_text_styled GXT 'KRIDE' time 1000 style 2 wait 3000 :NONAME_229wait 0 if and  Model.Available(#NRG500)  Model.Available(#BALLAS1)  Model.Available(#BALLAS2)  Model.Available(#BALLAS3)  Model.Available(#MP5LNG)  Model.Available(#MP5LNG)  Model.Available(#DESERT_EAGLE)023D:   special_actor 1 loaded 023D:   special_actor 2 loaded jf @NONAME_229 :NONAME_284wait 0 if 04EE:   animation "GANGS" loaded jf @NONAME_284 1@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528)Actor.Angle(1@) = 92.0506Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463)Actor.Angle($PLAYER_ACTOR) = 267.9048Player.CanMove($PLAYER_CHAR) = False02A3: enable_widescreen 1 Camera.SetPosition(2533.352, -1704.289, 13.3828, 0.0, 0.0, 0.0)Camera.PointAt(2533.238, -1717.788, 13.5119, 2)0605: actor 1@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 00BC: show_text_highpriority GXT 'HCISI' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'BCWAT' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'HWTGB' time 3000 flag 0 wait 3000 00BC: show_text_highpriority GXT 'TMFO' time 3000 flag 0 wait 2000 Camera.Restore_WithJumpCut02A3: enable_widescreen 0 0687: clear_actor 1@ task 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 0631: put_actor 1@ in_group $PLAYER_GROUP 01B2: give_actor 1@ weapon 24 ammo 10 // Load the weapon model before using this 01B9: set_actor 1@ armed_weapon_to 8 081A: set_actor 1@ weapon_skill_to 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 087E: set_actor 1@ weapon_droppable 1 Actor.Armour(1@) = 150Actor.Health(1@) = 100Player.CanMove($PLAYER_CHAR) = True20@ = Pickup.Create(1242, 3, 2533.86, -1692.545, 13.684)21@ = Pickup.Create(1240, 3, 2531.971, -1691.268, 13.7228)2@ = Car.Create(#NRG500, 2509.176, -1671.266, 13.0802)Car.Angle(2@) = 349.4163@ = Marker.CreateAboveCar(2@)Marker.SetColor(3@, 1)00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0:NONAME_782wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED if   Actor.InCar($PLAYER_ACTOR, 2@)jf @NONAME_782 00BC: show_text_highpriority GXT 'GTBSD' time 3000 flag 0 Marker.Disable(3@)018A: 3@ = create_checkpoint_at 2580.396 -2113.083 1.2353 03BC: 4@ = create_sphere_at 2580.396 -2113.083 1.2353 radius 3.0 :NONAME_892wait 0 if or  not Car.Wrecked(2@)  not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED if 0103:   actor $PLAYER_ACTOR in_sphere 2580.396 -2113.083 1.2353 radius 3.0 3.0 3.0 sphere 0 stopped_in_car jf @NONAME_892 Marker.Disable(3@)03BD: destroy_sphere 4@ Player.CanMove($PLAYER_CHAR) = False02A3: enable_widescreen 1 Camera.SetPosition(2571.298, -2131.141, 0.2417, 0.0, 0.0, 0.0)Camera.PointAt(2553.847, -2131.96, 0.1888, 2)5@ = Actor.Create(CivMale, #SPECIAL02, 2559.72, -2135.74, -0.0114)Actor.Angle(5@) = 357.24686@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261)Actor.Angle(6@) = 183.65857@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599)Actor.Angle(7@) = 267.31928@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276)Actor.Angle(8@) = 271.006701B2: give_actor 6@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 7@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 8@ weapon 29 ammo 1000 // Load the weapon model before using this 01B2: give_actor 5@ weapon 24 ammo 10 // Load the weapon model before using this 01B2: give_actor 5@ weapon 8 ammo 1 // Load the weapon model before using this Actor.Armour(5@) = 1000687: clear_actor 5@ task 0687: clear_actor 6@ task Actor.Health(5@) = 20001B9: set_actor 5@ armed_weapon_to 8 01B9: set_actor 6@ armed_weapon_to 29 01B9: set_actor 7@ armed_weapon_to 29 01B9: set_actor 8@ armed_weapon_to 29 081A: set_actor 5@ weapon_skill_to 0 0946: set_actor 5@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 6@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 7@ actions_uninterupted_by_weapon_fire 1 0946: set_actor 8@ actions_uninterupted_by_weapon_fire 1 087E: set_actor 5@ weapon_droppable 1 087E: set_actor 6@ weapon_droppable 1 087E: set_actor 7@ weapon_droppable 1 087E: set_actor 8@ weapon_droppable 1 0633: AS_actor $PLAYER_ACTOR exit_car 0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKD" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0632: release_group $PLAYER_GROUP 00BC: show_text_highpriority GXT 'IGIT' time 3000 flag 0 wait 2000 Player.CanMove($PLAYER_CHAR) = True02A3: enable_widescreen 0 Camera.Restore_WithJumpCut0633: AS_actor 1@ exit_car 05E2: AS_actor 1@ kill_actor 5@ 0630: put_actor 5@ in_group 9@ as_leader 0631: put_actor 6@ in_group 9@ 0631: put_actor 7@ in_group 9@ 0631: put_actor 8@ in_group 9@ 05E2: AS_actor 5@ kill_actor 1@ 05E2: AS_actor 6@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 7@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 8@ kill_actor $PLAYER_ACTOR 10@ = Marker.CreateAboveActor(5@)11@ = Marker.CreateAboveActor(6@)12@ = Marker.CreateAboveActor(7@)13@ = Marker.CreateAboveActor(8@)Marker.SetColor(10@, 0)Marker.SetColor(11@, 1073774847)Marker.SetColor(12@, 1073774847)Marker.SetColor(13@, 1073774847):NONAME_1614wait 0 if or   not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED if and  Actor.Dead(5@)  Actor.Dead(6@)  Actor.Dead(7@)  Actor.Dead(8@)jf @NONAME_1614 Marker.Disable(10@)Marker.Disable(11@)Marker.Disable(12@)Marker.Disable(13@)Actor.StorePos(5@, 14@, 15@, 16@)17@ = Pickup.Create(1254, 3, 14@, 15@, 16@)04C4: store_coords_to 30@ 31@ 32@ from_actor 5@ with_offset 0.0 -3.0 0.0 Camera.SetPosition(30@, 31@, 32@, 0.0, 0.0, 0.0)Camera.PointAt(14@, 15@, 16@, 2)0512: show_permanent_text_box 'CHBH' 03DC: 25@ = create_marker_above_pickup 17@ Marker.SetColor(25@, 0):NONAME_1819wait 0 if or                                                            not Actor.Dead($PLAYER_ACTOR)  not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILED if  Pickup.Picked_up(17@)jf @NONAME_1819 03E6: remove_text_box Pickup.Destroy(17@)Pickup.Destroy(20@)Pickup.Destroy(21@)0394: play_music 1 01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~Player.Money($PLAYER_CHAR) += 2000 $ONMISSION == 0 Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)04EF: release_animation "GANGS" Marker.Disable(-2):MISSIONFAILED00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!$ONMISSION == 0 Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)04EF: release_animation "GANGS" Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)return

 

Link to comment
Share on other sites

You have done some things wrong, you used gosub at every check if mission failed. Gosub works like this.

 

 

:MISSION_1wait 0if12@ == 30AA0: gosub_if_false @MISSION_2jump @MISSION_3:MISSION_212@ = 3return:MISSION_3...

 

 

If 12@ isn't 3 the code jumps to :MISSION_2 sets 12@ = 3 and returns to the place where the jump came from. Then the code jumps to :MISSION_3 and the rest of the code. Gosubs are usefull for checks or other things that have to be done many times.

 

In your case you used gosub wrong:

 

:NONAME_782wait 0if or not Car.Wrecked(2@) // You need to leave "not" here if you want to check if the car is wrecked btw not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)0AA0: gosub_if_false @MISSIONFAILEDif Actor.InCar($PLAYER_ACTOR, 2@)jf @NONAME_782 

 

 

The game will jump to Mission failed, but at the end is a return, and the code will jump back to here again.

You'll need to change it to:

 

:NONAME_892wait 0if or Car.Wrecked(2@) // I assume you want to go to Mission failed if the car is wrecked. not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @MISSIONFAILED if0103:   actor $PLAYER_ACTOR in_sphere 2580.396 -2113.083 1.2353 radius 3.0 3.0 3.0 sphere 0 stopped_in_carjf @NONAME_892

 

 

And at the end you need to change some thing,

 

:MISSIONFAILED00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!$ONMISSION == 0Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)04EF: release_animation "GANGS"Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)0296: unload_special_actor 1 // You forgot this 0296: unload_special_actor 2 // And thisjump @NONAME_24 // I assume you want to have the chanse to start over again

 

 

You will also need to check if some actors (and other things) are defined and remove refrence to them, if you want to do the cleanup part correct.

 

You always see mission failed, because the mission succeed part isn't correct either.

 

:NONAME_1819wait 0if or                                                           not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @MISSIONFAILEDif Pickup.Picked_up(17@)jf @NONAME_181903E6: remove_text_boxPickup.Destroy(17@)Pickup.Destroy(20@)Pickup.Destroy(21@)0394: play_music 101E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~Player.Money($PLAYER_CHAR) += 2000$ONMISSION == 0Actor.RemoveReferences(5@)Car.RemoveReferences(2@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(8@)// you need to check all the actors, spheres and cars over here to.Model.Destroy(#NRG500)Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)0296: unload_special_actor 1 // Same thing 0296: unload_special_actor 2 // Same thing04EF: release_animation "GANGS"Marker.Disable(-2) // What marker0A93: end_custom_thread // If you wan't to be able to play the mission again, you need to use "jump @NONAME_24"

 

 

As you can see you made 2 cleanups, here you should use gosub.

 

:MISSION_FAILgosub @CLEANUP00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!jump @NONAME_24:MISSION_PASSgosub @CLEANUP0394: play_music 101E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~0A93: end_custom_thread:MISSION_CLEANUP// Here the things you need to destroy and unloadreturn

 

 

For the next time keep in mind, if you write this:

 

:MISSION_1// Do something:MISSION_2// something

 

 

The code will automatically jump from :MISSION_1 to :MISSION_2

Link to comment
Share on other sites

Mission not following proper syntax (if wastedandbusted header) will ALWAYS crash when player is dead. $ONMISSION activates the proper "on mission" mode which requires this syntax. See original SA/VC/III missions and see how they begin.

Link to comment
Share on other sites

Gian_Yagami

@BadBoy: I do not understand about the gosub.

what it means 12@ == 3 & 12@ = 3 in your example script? confused.gif

 

so, I must Replace code: 0AA0: gosub_if_false to jf in row script :NONAME_782.

 

but I've read. jump code to read the code above/before. Is that right? then jf it's an extension of jump if false. what function does same? but I write the row code :MISSIONFAILED at the end. and row :NONAME_782 and row :NONAME892

 

@SilentPL: so which is it? confused.gif

Link to comment
Share on other sites

 

@SilentPL: so which is it?  confused.gif

You should be using a .cm file, the mission things only works in a mission thread.

 

In a mission thread when the player is wasted or busted the script returns from every gosub, so the rockstar syntax is:

 

 

gosub @MyMissionif wasted_or_busted   // returned from the sub because player is wasted\busted?then  gosub @MissionFailedendgosub @MissionCleanupend_thread:MyMission0317: increment_mission_attempts$ONMISSION = 1// the mission here, if the player is wasted or busted the script engine will return all the gosubsreturn:MissionFailed// Mission failed text etcreturn:MissionCleanup// Here you clean everything that you used in the mission$ONMISSION = 000D8: mission_cleanupreturn

 

Link to comment
Share on other sites

Gian_Yagami

@Link2012: oh, thanks smile.gif

 

 

what it means 12@ == 3 & 12@ = 3 in your example script? 

 

so, I must Replace code: 0AA0: gosub_if_false to jf in row script :NONAME_782.

 

but I've read. jump code to read the code above/before. Is that right? then jf it's an extension of jump if false. what function does same? but I write the row code :MISSIONFAILED at the end. and row :NONAME_782 and row :NONAME892

 

whatsthat.gif I'm still waiting for answers.

Link to comment
Share on other sites

 

but I've read. jump code to read the code above/before. Is that right? then jf it's an extension of jump if false. what function does same? but I write the row code :MISSIONFAILED at the end. and row :NONAME_782 and row :NONAME892

 

I don't understand you. 12@ was just an example. And you have to replace gosub everywere. Your script should look like this now.

 

Sniffer (you can use 0AB3 instead of global variables but this one should be free):

 

thread 'SNIFFER' $8301 = 00@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471):SNIFFER_24wait 0if and  00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere 2536.422 -1694.349 13.6471 radius 1.6 1.6 1.6 on_foot   Player.Controllable($PLAYER_CHAR)  $8301 == 0 jf @SNIFFER_130 $ONMISSION = 1 {00BA: show_text_styled GXT 'X' time 1000 style 2 // You could put your mission name here}  0A94: start_custom_mission "MISSION1" fade 0 250Marker.Disable(0@)jump @SNIFFER_24:SNIFFER_130if   $ONMISSION == 1jf @SNIFFER_160 repeat   wait $DEFAULT_WAIT_TIMEuntil $ONMISSION == 0if   $8301 == 0jf @SNIFFER_1600@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471)jump @SNIFFER_24   :SNIFFER_160if$8301 == 1jf @SNIFFER_24Marker.Disable(0@)0A93: end_custom_thread

 

 

Mission (you can use up to 1024 locals in this construction):

 

{$CLEO .cm}Thread 'MISSION1'gosub @MyMissionif wasted_or_busted   // returned from the sub because player is wasted\busted?then gosub @MissionFailedendgosub @MissionCleanupend_thread:MyMission0317: increment_mission_attemptswait 250Model.Load(#NRG500)Model.Load(#BALLAS1)Model.Load(#BALLAS2)Model.Load(#BALLAS3)Model.Load(#MP5LNG)Model.Load(#DESERT_EAGLE)Model.Load(#KATANA)023C: load_special_actor 'FAIZ555' as 1 // models 290-299023C: load_special_actor 'DECADE' as 2 // models 290-29904ED: load_animation "GANGS"038B: load_requested_models repeat   wait 0until 04EE:   animation "GANGS" loaded  02A3: enable_widescreen 1Camera.SetPosition(2525.352, -1704.289, 23.3828, 0.0, 0.0, 0.0)Camera.PointAt(2525.238, -1717.788, 23.5119, 2)fade 1 250wait 25000BA: show_text_styled GXT 'KRIDE' time 1000 style 2wait 30001@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528)Actor.Angle(1@) = 92.0506Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463)Actor.Angle($PLAYER_ACTOR) = 267.9048Player.CanMove($PLAYER_CHAR) = False02A3: enable_widescreen 1Camera.SetPosition(2533.352, -1704.289, 13.3828, 0.0, 0.0, 0.0)Camera.PointAt(2533.238, -1717.788, 13.5119, 2)0605: actor 1@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA00BC: show_text_highpriority GXT 'HCISI' time 3000 flag 0wait 300000BC: show_text_highpriority GXT 'BCWAT' time 3000 flag 0wait 300000BC: show_text_highpriority GXT 'HWTGB' time 3000 flag 0wait 300000BC: show_text_highpriority GXT 'TMFO' time 3000 flag 0wait 2000Camera.Restore_WithJumpCut02A3: enable_widescreen 00687: clear_actor 1@ task07AF: $PLAYER_GROUP = player $PLAYER_CHAR group0631: put_actor 1@ in_group $PLAYER_GROUP01B2: give_actor 1@ weapon 24 ammo 10 // Load the weapon model before using this01B9: set_actor 1@ armed_weapon_to 8081A: set_actor 1@ weapon_skill_to 00946: set_actor 1@ actions_uninterupted_by_weapon_fire 1087E: set_actor 1@ weapon_droppable 1Actor.Armour(1@) = 150Actor.Health(1@) = 100Player.CanMove($PLAYER_CHAR) = True20@ = Pickup.Create(1242, 3, 2533.86, -1692.545, 13.684)21@ = Pickup.Create(1240, 3, 2531.971, -1691.268, 13.7228)2@ = Car.Create(#NRG500, 2509.176, -1671.266, 13.0802)Car.Angle(2@) = 349.4163@ = Marker.CreateAboveCar(2@)Marker.SetColor(3@, 1)00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0:NONAME_782wait 0if or not Car.Wrecked(2@) not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @FAILif Actor.InCar($PLAYER_ACTOR, 2@)jf @NONAME_78200BC: show_text_highpriority GXT 'GTBSD' time 3000 flag 0Marker.Disable(3@)018A: 3@ = create_checkpoint_at 2580.396 -2113.083 1.235303BC: 4@ = create_sphere_at 2580.396 -2113.083 1.2353 radius 3.0:NONAME_892wait 0if or not Car.Wrecked(2@) not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @FAILif0103:   actor $PLAYER_ACTOR in_sphere 2580.396 -2113.083 1.2353 radius 3.0 3.0 3.0 sphere 0 stopped_in_carjf @NONAME_892Marker.Disable(3@)03BD: destroy_sphere [email protected]($PLAYER_CHAR) = False02A3: enable_widescreen 1Camera.SetPosition(2571.298, -2131.141, 0.2417, 0.0, 0.0, 0.0)Camera.PointAt(2553.847, -2131.96, 0.1888, 2)5@ = Actor.Create(CivMale, #SPECIAL02, 2559.72, -2135.74, -0.0114)Actor.Angle(5@) = 357.24686@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261)Actor.Angle(6@) = 183.65857@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599)Actor.Angle(7@) = 267.31928@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276)Actor.Angle(8@) = 271.006701B2: give_actor 6@ weapon 29 ammo 1000 // Load the weapon model before using this01B2: give_actor 7@ weapon 29 ammo 1000 // Load the weapon model before using this01B2: give_actor 8@ weapon 29 ammo 1000 // Load the weapon model before using this01B2: give_actor 5@ weapon 24 ammo 10 // Load the weapon model before using this01B2: give_actor 5@ weapon 8 ammo 1 // Load the weapon model before using thisActor.Armour(5@) = 1000687: clear_actor 5@ task0687: clear_actor 6@ taskActor.Health(5@) = 20001B9: set_actor 5@ armed_weapon_to 801B9: set_actor 6@ armed_weapon_to 2901B9: set_actor 7@ armed_weapon_to 2901B9: set_actor 8@ armed_weapon_to 29081A: set_actor 5@ weapon_skill_to 00946: set_actor 5@ actions_uninterupted_by_weapon_fire 10946: set_actor 6@ actions_uninterupted_by_weapon_fire 10946: set_actor 7@ actions_uninterupted_by_weapon_fire 10946: set_actor 8@ actions_uninterupted_by_weapon_fire 1087E: set_actor 5@ weapon_droppable 1087E: set_actor 6@ weapon_droppable 1087E: set_actor 7@ weapon_droppable 1087E: set_actor 8@ weapon_droppable 10633: AS_actor $PLAYER_ACTOR exit_car0605: actor 5@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA0605: actor 6@ perform_animation_sequence "PRTIAL_GNGTLKD" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA0632: release_group $PLAYER_GROUP00BC: show_text_highpriority GXT 'IGIT' time 3000 flag 0wait 2000Player.CanMove($PLAYER_CHAR) = True02A3: enable_widescreen 0Camera.Restore_WithJumpCut0633: AS_actor 1@ exit_car05E2: AS_actor 1@ kill_actor 5@0630: put_actor 5@ in_group 9@ as_leader0631: put_actor 6@ in_group 9@0631: put_actor 7@ in_group 9@0631: put_actor 8@ in_group 9@05E2: AS_actor 5@ kill_actor 1@05E2: AS_actor 6@ kill_actor $PLAYER_ACTOR05E2: AS_actor 7@ kill_actor $PLAYER_ACTOR05E2: AS_actor 8@ kill_actor $PLAYER_ACTOR10@ = Marker.CreateAboveActor(5@)11@ = Marker.CreateAboveActor(6@)12@ = Marker.CreateAboveActor(7@)13@ = Marker.CreateAboveActor(8@)Marker.SetColor(10@, 0)Marker.SetColor(11@, 1073774847)Marker.SetColor(12@, 1073774847)Marker.SetColor(13@, 1073774847):NONAME_1614wait 0if or not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @FAILif and Actor.Dead(5@) Actor.Dead(6@) Actor.Dead(7@) Actor.Dead(8@)jf @NONAME_1614Marker.Disable(10@)Marker.Disable(11@)Marker.Disable(12@)Marker.Disable(13@)Actor.StorePos(5@, 14@, 15@, 16@)17@ = Pickup.Create(1254, 3, 14@, 15@, 16@)04C4: store_coords_to 30@ 31@ 32@ from_actor 5@ with_offset 0.0 -3.0 0.0Camera.SetPosition(30@, 31@, 32@, 0.0, 0.0, 0.0)Camera.PointAt(14@, 15@, 16@, 2)0512: show_permanent_text_box 'CHBH'03DC: 25@ = create_marker_above_pickup [email protected](25@, 0):NONAME_1819wait 0if or                                                           not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@)jf @FAILif Pickup.Picked_up(17@)jf @NONAME_181903E6: remove_text_boxPickup.Destroy(17@)Pickup.Destroy(20@)Pickup.Destroy(21@)gosub @MISSION_PASSEDreturn:MISSION_PASSED0394: play_music 101E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~Player.Money($PLAYER_CHAR) += 2000$8301 = 1return:FAILgosub @MissionFailedgosub @MissionCleanup004E: end_thread :MissionFailed00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!return:MissionCleanup04EF: release_animation "GANGS"Model.Destroy(#NRG500) // I am not sure if this is needed, because of 00D8Model.Destroy(#DESERT_EAGLE)Model.Destroy(#MP5LNG)Model.Destroy(#BALLAS1)Model.Destroy(#BALLAS2)Model.Destroy(#BALLAS3)$ONMISSION = 000D8: mission_cleanupreturn

 

Edited by Bad.boy!
Link to comment
Share on other sites

Gian_Yagami

okay. I'll ask again later. I will be offline for a long time

 

Thanks everyone. happy.gif

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.