|
 |
|
|
|
|
|
GTA Modification Forums
Why My Mission crash if mission failed? SA Mission CLEO 4
 |
|
 |
| |
Gian_Yagami  |
|
Rat

Group: Members
Joined: Nov 8, 2011


|
sorry trouble, could you check this? Why My Mission crash if mission failed| CODE | // 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_24 wait 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_229 wait 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_284 wait 0 if 04EE: animation "GANGS" loaded jf @NONAME_284 1@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528) Actor.Angle(1@) = 92.0506 Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463) Actor.Angle($PLAYER_ACTOR) = 267.9048 Player.CanMove($PLAYER_CHAR) = False 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_WithJumpCut 02A3: 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@) = 150 Actor.Health(1@) = 100 Player.CanMove($PLAYER_CHAR) = True 20@ = 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.416 3@ = Marker.CreateAboveCar(2@) Marker.SetColor(3@, 1) 00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0 :NONAME_782 wait 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_892 wait 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) = False 02A3: 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.2468 6@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261) Actor.Angle(6@) = 183.6585 7@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599) Actor.Angle(7@) = 267.3192 8@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276) Actor.Angle(8@) = 271.0067 01B2: 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@) = 100 0687: clear_actor 5@ task 0687: clear_actor 6@ task Actor.Health(5@) = 200 01B9: 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) = True 02A3: enable_widescreen 0 Camera.Restore_WithJumpCut 0633: 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_1614 wait 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_1819 wait 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)
:MISSIONFALED 00BA: 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?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Joni2030  |
|
Prankster

Group: Members
Joined: Jul 6, 2011


|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Gian_Yagami  |
|
Rat

Group: Members
Joined: Nov 8, 2011


|
Sorry late relpy. so? how?  please... what cleo mission must be in cm format yeah, I think cm= Cleo Mission. that's true? This post has been edited by Gian_Yagami on Monday, Apr 2 2012, 08:08
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Gian_Yagami  |
Posted: Thursday, Apr 5 2012, 08:21
|
Rat

Group: Members
Joined: Nov 8, 2011


|
so what should I change to fix icon 17@? & why first and second parameter not work? | CODE | :NONAME_782 wait 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 | CODE | :NONAME_892 wait 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: | CODE | 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_WithJumpCut 02A3: 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@) = 150 Actor.Health(1@) = 100 Player.CanMove($PLAYER_CHAR) = True 20@ = 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.416 3@ = 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 | CODE | 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 |
[CODE]
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Gian_Yagami  |
|
Rat

Group: Members
Joined: Nov 8, 2011


|
sure  this my script: | CODE | {$VERSION 3.1.0027} {$CLEO .cs}
//-------------MAIN--------------- 0000: NOP 0@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471)
:NONAME_24 wait 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_229 wait 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_284 wait 0 if 04EE: animation "GANGS" loaded jf @NONAME_284 1@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528) Actor.Angle(1@) = 92.0506 Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463) Actor.Angle($PLAYER_ACTOR) = 267.9048 Player.CanMove($PLAYER_CHAR) = False 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_WithJumpCut 02A3: 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@) = 150 Actor.Health(1@) = 100 Player.CanMove($PLAYER_CHAR) = True 20@ = 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.416 3@ = Marker.CreateAboveCar(2@) Marker.SetColor(3@, 1) 00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0 :NONAME_782 wait 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_892 wait 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) = False 02A3: 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.2468 6@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261) Actor.Angle(6@) = 183.6585 7@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599) Actor.Angle(7@) = 267.3192 8@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276) Actor.Angle(8@) = 271.0067 01B2: 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@) = 100 0687: clear_actor 5@ task 0687: clear_actor 6@ task Actor.Health(5@) = 200 01B9: 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) = True 02A3: enable_widescreen 0 Camera.Restore_WithJumpCut 0633: 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_1614 wait 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_1819 wait 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)
:MISSIONFAILED 00BA: 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 |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Bad.boy!  |
|
SA modder

Group: Members
Joined: Jun 20, 2010


|
You have done some things wrong, you used gosub at every check if mission failed. Gosub works like this. | CODE | :MISSION_1 wait 0 if 12@ == 3 0AA0: gosub_if_false @MISSION_2 jump @MISSION_3
:MISSION_2 12@ = 3 return
: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: | CODE | :NONAME_782 wait 0 if 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 @MISSIONFAILED if 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: | CODE | :NONAME_892 wait 0 if 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 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 |
And at the end you need to change some thing, | CODE | :MISSIONFAILED 00BA: 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) 0296: unload_special_actor 1 // You forgot this 0296: unload_special_actor 2 // And this jump @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. | CODE | :NONAME_1819 wait 0 if or not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@) jf @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@) // 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 thing 04EF: release_animation "GANGS" Marker.Disable(-2) // What marker 0A93: 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. | CODE | :MISSION_FAIL gosub @CLEANUP 00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED! jump @NONAME_24
:MISSION_PASS gosub @CLEANUP 0394: play_music 1 01E3: 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 unload return |
For the next time keep in mind, if you write this: | CODE | :MISSION_1 // Do something
:MISSION_2 // something |
The code will automatically jump from :MISSION_1 to :MISSION_2
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Gian_Yagami  |
Posted: Saturday, Apr 7 2012, 09:57
|
Rat

Group: Members
Joined: Nov 8, 2011


|
@BadBoy: I do not understand about the gosub. 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@SilentPL: so which is it?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Bad.boy!  |
|
SA modder

Group: Members
Joined: Jun 20, 2010


|
| QUOTE | | 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): | CODE | thread 'SNIFFER' $8301 = 0 0@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471)
:SNIFFER_24 wait 0 if 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 250 Marker.Disable(0@) jump @SNIFFER_24
:SNIFFER_130 if $ONMISSION == 1 jf @SNIFFER_160 repeat wait $DEFAULT_WAIT_TIME until $ONMISSION == 0 if $8301 == 0 jf @SNIFFER_160 0@ = Marker.CreateIconAndSphere(61, 2536.422, -1694.349, 13.6471) jump @SNIFFER_24
:SNIFFER_160 if $8301 == 1 jf @SNIFFER_24 Marker.Disable(0@) 0A93: end_custom_thread |
Mission (you can use up to 1024 locals in this construction): | CODE | {$CLEO .cm}
Thread 'MISSION1' gosub @MyMission if wasted_or_busted // returned from the sub because player is wasted\busted? then gosub @MissionFailed end gosub @MissionCleanup end_thread
:MyMission 0317: increment_mission_attempts wait 250 Model.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-299 023C: load_special_actor 'DECADE' as 2 // models 290-299 04ED: load_animation "GANGS" 038B: load_requested_models repeat wait 0 until 04EE: animation "GANGS" loaded 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) fade 1 250 wait 250 00BA: show_text_styled GXT 'KRIDE' time 1000 style 2 wait 3000 1@ = Actor.Create(CivMale, #SPECIAL01, 2535.664, -1711.413, 13.4528) Actor.Angle(1@) = 92.0506 Actor.PutAt($PLAYER_ACTOR, 2531.636, -1711.278, 13.463) Actor.Angle($PLAYER_ACTOR) = 267.9048 Player.CanMove($PLAYER_CHAR) = False 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_WithJumpCut 02A3: 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@) = 150 Actor.Health(1@) = 100 Player.CanMove($PLAYER_CHAR) = True 20@ = 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.416 3@ = Marker.CreateAboveCar(2@) Marker.SetColor(3@, 1) 00BC: show_text_highpriority GXT 'GITC' time 3000 flag 0
:NONAME_782 wait 0 if or not Car.Wrecked(2@) not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@) jf @FAIL 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_892 wait 0 if or not Car.Wrecked(2@) not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@) jf @FAIL 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) = False 02A3: 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.2468 6@ = Actor.Create(Gang1, #BALLAS1, 2559.714, -2133.241, 0.1261) Actor.Angle(6@) = 183.6585 7@ = Actor.Create(Gang1, #BALLAS2, 2554.731, -2130.668, 0.2599) Actor.Angle(7@) = 267.3192 8@ = Actor.Create(Gang1, #BALLAS3, 2554.995, -2130.374, 0.276) Actor.Angle(8@) = 271.0067 01B2: 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@) = 100 0687: clear_actor 5@ task 0687: clear_actor 6@ task Actor.Health(5@) = 200 01B9: 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) = True 02A3: enable_widescreen 0 Camera.Restore_WithJumpCut 0633: 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_1614 wait 0 if or not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@) jf @FAIL 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_1819 wait 0 if or not Actor.Dead($PLAYER_ACTOR) not Actor.Dead(1@) jf @FAIL if Pickup.Picked_up(17@) jf @NONAME_1819 03E6: remove_text_box Pickup.Destroy(17@) Pickup.Destroy(20@) Pickup.Destroy(21@) gosub @MISSION_PASSED return
:MISSION_PASSED 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 $8301 = 1 return
:FAIL gosub @MissionFailed gosub @MissionCleanup 004E: end_thread
:MissionFailed 00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1 // ~r~MISSION FAILED! return
:MissionCleanup 04EF: release_animation "GANGS" Model.Destroy(#NRG500) // I am not sure if this is needed, because of 00D8 Model.Destroy(#DESERT_EAGLE) Model.Destroy(#MP5LNG) Model.Destroy(#BALLAS1) Model.Destroy(#BALLAS2) Model.Destroy(#BALLAS3) $ONMISSION = 0 00D8: mission_cleanup return | This post has been edited by Bad.boy! on Sunday, Apr 8 2012, 15:38
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|