Fenton Posted March 25, 2014 Share Posted March 25, 2014 (edited) Hey guys, I wan't to remove a actor from turret if the actor has been killed by the player but the one problem, After i kill the actor, the actor still here not detached from the vehicle. Here it is the script EDIT : Sorry my mistake wait 100ifActor.Dead(7@)else_jump @NONAME_7480407: store_coords_to 21@ 22@ 23@ from_car 0@ with_offset 1.3 0.0 1.2Actor.StorePos(7@, 21@, 22@, 23@)0465: remove_actor 7@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(7@)wait 30000jump @NONAME_2 Edited March 25, 2014 by ALAN41 Link to comment Share on other sites More sharing options...
KELASHI Posted March 25, 2014 Share Posted March 25, 2014 Actor 7@? 17@? Link to comment Share on other sites More sharing options...
xNCx Posted March 25, 2014 Share Posted March 25, 2014 You can also try to check, if his health is < 1. Maybe the turret option handles death differently. Link to comment Share on other sites More sharing options...
ZAZ Posted March 25, 2014 Share Posted March 25, 2014 normally it works i assume your script doesn't have a propper loop, also there're useless codes in your snippet so post your whole script CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Fenton Posted March 25, 2014 Author Share Posted March 25, 2014 (edited) // This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$CLEO .cs}//-------------MAIN---------------0000: NOP:NONAME_2wait 100096A: enable_flying_helis 0if Player.Defined($PLAYER_CHAR)else_jump @NONAME_2if and $ACTIVE_INTERIOR == 0 Player.WantedLevel($PLAYER_CHAR) > 2else_jump @NONAME_2jump @NONAME_58:NONAME_58wait 5000Model.Load(#POLMAV)Model.Load(#SWAT)Model.Load(#MP5LNG)ifModel.Load(#POLMAV) Model.Available(#SWAT) Model.Available(#MP5LNG)else_jump @NONAME_58038B: load_requested_modelsjump @NONAME_113:NONAME_113wait 400004C4: store_coords_to 8@ 9@ 10@ from_actor $PLAYER_ACTOR with_offset 2.0 4.0 22.004D3: get_nearest_car_path_coords_from 8@ 9@ 10@ type 0 store_to 19@ 20@ 21@0@ = Car.Create(#POLMAV, 19@, 20@, 10@)Car.StorePos(0@, 1@, 2@, 3@)0825: set_helicopter 0@ instant_rotor_start0727: set_heli 0@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 14.00129: 4@ = create_actor_pedtype 6 model #SWAT in_car 0@ driverseat01C8: 5@ = create_actor_pedtype 6 model #SWAT in_car 0@ passenger_seat 06@ = Actor.Create(Cop, #SWAT, 1@, 2@, 3@)7@ = Actor.Create(Cop, #SWAT, 1@, 2@, 3@)17@ = Actor.Create(Cop, #SWAT, 1@, 2@, 3@)18@ = Actor.Create(Cop, #SWAT, 1@, 2@, 3@)01B2: give_actor 6@ weapon 29 ammo 9999 // Load the weapon model before using this01B2: give_actor 7@ weapon 29 ammo 9999 // Load the weapon model before using this01B2: give_actor 17@ weapon 29 ammo 9999 // Load the weapon model before using this01B2: give_actor 18@ weapon 29 ammo 9999 // Load the weapon model before using thisActor.WeaponAccuracy(6@) = 45Actor.WeaponAccuracy(7@) = 45Actor.WeaponAccuracy(17@) = 45Actor.WeaponAccuracy(18@) = 450464: put_actor 6@ into_turret_on_car 0@ at_car_offset 1.4 1.3 -0.1 position 3 shooting_angle_limit 190.0 with_weapon 290350: set_actor 6@ maintain_position_when_attacked 104EB: AS_actor 6@ crouch 10464: put_actor 7@ into_turret_on_car 0@ at_car_offset 1.4 -0.8 -0.1 position 3 shooting_angle_limit 190.0 with_weapon 290350: set_actor 7@ maintain_position_when_attacked 104EB: AS_actor 7@ crouch 10464: put_actor 17@ into_turret_on_car 0@ at_car_offset -1.4 1.3 -0.1 position 1 shooting_angle_limit 190.0 with_weapon 290350: set_actor 17@ maintain_position_when_attacked 104EB: AS_actor 17@ crouch 10464: put_actor 18@ into_turret_on_car 0@ at_car_offset -1.4 -0.8 -0.1 position 1 shooting_angle_limit 190.0 with_weapon 290350: set_actor 18@ maintain_position_when_attacked 104EB: AS_actor 18@ crouch 107A5: AS_actor 6@ attack_actor $PLAYER_ACTOR 999999 ms07A5: AS_actor 7@ attack_actor $PLAYER_ACTOR 999999 ms07A5: AS_actor 18@ attack_actor $PLAYER_ACTOR 999999 ms07A5: AS_actor 17@ attack_actor $PLAYER_ACTOR 999999 ms:NONAME_572wait 100if Actor.Dead(4@)else_jump @NONAME_661Car.Health(0@) = 00564: heli 0@ simulate_crash_landing0465: remove_actor 6@ from_turret_mode0465: remove_actor 7@ from_turret_mode0465: remove_actor 17@ from_turret_mode0465: remove_actor 18@ from_turret_modeModel.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)wait 30000jump @NONAME_2:NONAME_661wait 100if or02BF: car 0@ sunk Car.Wrecked(0@)else_jump @NONAME_7480465: remove_actor 6@ from_turret_mode0465: remove_actor 7@ from_turret_mode0465: remove_actor 17@ from_turret_mode0465: remove_actor 18@ from_turret_modeModel.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)wait 30000jump @NONAME_2:NONAME_748wait 100if or8202: not actor $PLAYER_ACTOR near_car 0@ radius 110.0 110.0 flag 0 not Player.WantedLevel($PLAYER_CHAR) > 2 not $ACTIVE_INTERIOR == 0 else_jump @NONAME_97504C4: store_coords_to 14@ 15@ 16@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 90.004A2: set_heli 0@ fly_to 14@ 15@ 16@ altitude_between 0.0 and 16@Car.SetImmunities(0@, 0, 0, 0, 0, 0)//0407: store_coords_to 21@ 22@ 23@ from_car 0@ with_offset 1.3 0.0 1.2//Actor.StorePos(6@, 21@, 22@, 23@)//Actor.DestroyInstantly(6@)//0503: create_actor_on_rope_with_pedtype 24 model #SWAT at 21@ 22@ 23@ handle_as 6@//Actor.StorePos(7@, 21@, 22@, 23@)//Actor.DestroyInstantly(7@)//0503: create_actor_on_rope_with_pedtype 24 model #SWAT at 21@ 22@ 23@ handle_as 7@//Actor.StorePos(17@, 21@, 22@, 23@)//Actor.DestroyInstantly(17@)//503: create_actor_on_rope_with_pedtype 24 model #SWAT at 21@ 22@ 23@ handle_as 17@//Actor.StorePos(18@, 21@, 22@, 23@)//Actor.DestroyInstantly(18@)//0503: create_actor_on_rope_with_pedtype 24 model #SWAT at 21@ 22@ 23@ handle_as 18@//wait 1000//01B2: give_actor 6@ weapon 29 ammo 9999 // Load the weapon model before using this//01B2: give_actor 7@ weapon 29 ammo 9999 // Load the weapon model before using this//01B2: give_actor 17@ weapon 29 ammo 9999 // Load the weapon model before using this//01B2: give_actor 18@ weapon 29 ammo 9999 // Load the weapon model before using thiswait 10000Model.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)jump @NONAME_2wait 100ifActor.Dead(6@)else_jump @NONAME_7480465: remove_actor 6@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(6@)wait 30000jump @NONAME_2wait 100ifActor.Dead(7@)else_jump @NONAME_7480465: remove_actor 7@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(7@)wait 30000jump @NONAME_2wait 100ifActor.Dead(17@)else_jump @NONAME_7480465: remove_actor 17@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(17@)wait 30000jump @NONAME_2wait 100ifActor.Dead(18@)else_jump @NONAME_7480465: remove_actor 18@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(18@)wait 30000jump @NONAME_2:NONAME_975wait 100if Actor.InCar($PLAYER_ACTOR, 0@)else_jump @NONAME_117700BB: show_text_lowpriority GXT 'P' time 5000 flag 10221: set_player $PLAYER_CHAR trapped_in_car 10508: car 0@ close_all_doorsCar.LockInCurrentPosition(0@) = True0465: remove_actor 6@ from_turret_mode0465: remove_actor 7@ from_turret_mode0465: remove_actor 17@ from_turret_mode0465: remove_actor 18@ from_turret_mode0825: set_helicopter 0@ instant_rotor_startCar.SetMaxSpeed(0@, 120.0)020B: explode_car 0@ // versionA0221: set_player $PLAYER_CHAR trapped_in_car 0wait 1000Model.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)wait 10000jump @NONAME_2:NONAME_1177wait 100if or Actor.Dead($PLAYER_ACTOR)0741: actor $PLAYER_ACTOR bustedelse_jump @NONAME_572Player.WantedLevel($PLAYER_CHAR) = 0wait 100Car.Destroy(0@)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)Model.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)wait 10000jump @NONAME_2 Edited March 25, 2014 by ALAN41 Link to comment Share on other sites More sharing options...
ZAZ Posted March 27, 2014 Share Posted March 27, 2014 you asked why this scriptblock don't work wait 100ifActor.Dead(7@)else_jump @NONAME_7480407: store_coords_to 21@ 22@ 23@ from_car 0@ with_offset 1.3 0.0 1.2Actor.StorePos(7@, 21@, 22@, 23@)0465: remove_actor 7@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(7@)wait 30000jump @NONAME_2it don't work because it will not be read your whole script have jump to label NONAME_2 befor your scriptblocks Model.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)jump @NONAME_2 <----------------------- here it jumps to label NONAME_2 and the rest below will not be readwait 100ifActor.Dead(6@)else_jump @NONAME_7480465: remove_actor 6@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(6@)wait 30000jump @NONAME_2wait 100ifActor.Dead(7@)else_jump @NONAME_7480465: remove_actor 7@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(7@)wait 30000jump @NONAME_2wait 100ifActor.Dead(17@)else_jump @NONAME_7480465: remove_actor 17@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(17@)wait 30000jump @NONAME_2wait 100ifActor.Dead(18@)else_jump @NONAME_7480465: remove_actor 18@ from_turret_modewait 1000Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Actor.RemoveReferences(18@)wait 30000jump @NONAME_2:NONAME_975wait 100if Actor.InCar($PLAYER_ACTOR, 0@)else_jump @NONAME_117700BB: show_text_lowpriority GXT 'P' time 5000 flag 10221: set_player $PLAYER_CHAR trapped_in_car 10508: car 0@ close_all_doorsCar.LockInCurrentPosition(0@) = True0465: remove_actor 6@ from_turret_mode0465: remove_actor 7@ from_turret_mode0465: remove_actor 17@ from_turret_mode0465: remove_actor 18@ from_turret_mode0825: set_helicopter 0@ instant_rotor_startCar.SetMaxSpeed(0@, 120.0)020B: explode_car 0@ // versionA0221: set_player $PLAYER_CHAR trapped_in_car 0wait 1000Model.Destroy(#POLMAV)Model.Destroy(#MP5LNG)Model.Destroy(#SWAT)Car.RemoveReferences(0@)Actor.RemoveReferences(4@)Actor.RemoveReferences(5@)Actor.RemoveReferences(6@)Actor.RemoveReferences(7@)Actor.RemoveReferences(17@)Actor.RemoveReferences(18@)wait 10000jump @NONAME_2gave it up and learn first coding by writing own simple scripts CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Fenton Posted March 29, 2014 Author Share Posted March 29, 2014 (edited) It works for first gunner, But it won't works for second gunner, I've remove third and fourth gunner from the script EDIT : Working properly for now, Thanks anyway Edited April 4, 2014 by ALAN41 Link to comment 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