Shiro Naomi Posted February 26, 2021 Share Posted February 26, 2021 Suppose I add 2 hunters in 1 single script If I destroy a hunter, it must respawn the hunter I destroyed The problem is that when I destroy one hunter, I have to destroy the other one to respawn both of them I tried many ways to make conditionals, but it results in the same thing How can I do it? //-------------MAIN--------------- thread 'LV6' :LV6_11 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @LV6_11 if Player.WantedLevel($PLAYER_CHAR) > 1 else_jump @LV6_11 Model.Load(#ARMY) Model.Load(#M4) Model.Load(#HEATSEEK) Model.Load(#HUNTER 038B: load_requested_models :LV6_164 wait 0 if and Model.Available(#ARMY) Model.Available(#M4) Model.Available(#HEATSEEK) Model.Available(#HUNTER) else_jump @LV6_164 :LV6_209 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @LV6_2135 if and not Actor.Driving($PLAYER_ACTOR) Player.WantedLevel($PLAYER_CHAR) > 1 else_jump @LV6_2135 077E: get_active_interior_to 30@ if 30@ == 0 else_jump @LV6_209 :LV6_282 if and Car.Wrecked(6@) Actor.Dead(8@) then Actor.DestroyInstantly($gc1) Actor.DestroyInstantly($gc2) Actor.DestroyInstantly($gc3) Actor.DestroyInstantly($gc4) Actor.DestroyInstantly($gc5) Actor.DestroyInstantly($gc6) end if 056E: car 6@ defined else_jump @LV6_398 if or Car.Wrecked(6@) 8205: not actor $PLAYER_ACTOR near_car 6@ radius 500.0 500.0 500.0 flag 0 else_jump @LV6_391 Car.RemoveReferences(6@) Actor.RemoveReferences(8@) 6@ = 0 8@ = 0 :LV6_391 jump @LV6_604 :LV6_398 Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) 0208: 3@ = random_float_in_ranges 0.0 360.0 02F7: 4@ = cosine 3@ // (float) 02F6: 5@ = sine 3@ // (float) 4@ *= 50.0 5@ *= 50.0 0063: 0@ -= 4@ // (float) 0063: 1@ -= 5@ // (float) 2@ += 50.0 02CE: 2@ = ground_z_at 0@ 1@ 2@ 2@ += 50.0 6@ = Car.Create(#HUNTER, 0@, 1@, 2@) Car.Angle(6@) = 3@ 8@ = Actor.CreateAsDriver(Cop, #ARMY, 6@) Car.ImmuneToNonPlayer(6@, True) 0724: heli 6@ follow_and_attack_player $PLAYER_CHAR altitude_between 30.0 and 0.0 0825: set_helicopter 6@ instant_rotor_start 0841: flying_vehicle 6@ use_primary_gun 1 07BB: set_heli 6@ horizontal_thrust_power 0 04DF: set_heli 6@ lean_and_thrust_limiter -100 Actor.Create($gc1, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc2, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc3, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc4, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc5, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc6, Cop, #ARMY, 0@ 1@ 2@) 0337: set_actor $gc1 visibility 0 0337: set_actor $gc2 visibility 0 0337: set_actor $gc3 visibility 0 0337: set_actor $gc4 visibility 0 0337: set_actor $gc5 visibility 0 0337: set_actor $gc6 visibility 0 Actor.SetImmunities($gc1, True, True, True, True, True) Actor.SetImmunities($gc2, True, True, True, True, True) Actor.SetImmunities($gc3, True, True, True, True, True) Actor.SetImmunities($gc4, True, True, True, True, True) Actor.SetImmunities($gc5, True, True, True, True, True) Actor.SetImmunities($gc6, True, True, True, True, True) Actor.WeaponAccuracy($gc1) = 100 Actor.WeaponAccuracy($gc2) = 100 Actor.WeaponAccuracy($gc3) = 100 Actor.WeaponAccuracy($gc4) = 100 Actor.WeaponAccuracy($gc5) = 100 Actor.WeaponAccuracy($gc6) = 100 07DD: set_actor $gc1 attack_rate 500 07DD: set_actor $gc2 attack_rate 500 07DD: set_actor $gc3 attack_rate 500 07DD: set_actor $gc4 attack_rate 500 07DD: set_actor $gc5 attack_rate 500 07DD: set_actor $gc6 attack_rate 500 0464: put_actor $gc1 into_turret_on_car 6@ at_car_offset 0.0 5.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 0464: put_actor $gc2 into_turret_on_car 6@ at_car_offset 0.0 5.0 1.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 0464: put_actor $gc3 into_turret_on_car 6@ at_car_offset -1.0 4.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 0464: put_actor $gc4 into_turret_on_car 6@ at_car_offset 1.0 4.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 0464: put_actor $gc5 into_turret_on_car 6@ at_car_offset -1.0 5.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 0464: put_actor $gc6 into_turret_on_car 6@ at_car_offset 1.0 5.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 31 05E2: AS_actor $gc1 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc2 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc3 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc4 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc5 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc6 kill_actor $PLAYER_ACTOR Actor.RemoveReferences($gc1) Actor.RemoveReferences($gc2) Actor.RemoveReferences($gc3) Actor.RemoveReferences($gc4) Actor.RemoveReferences($gc5) Actor.RemoveReferences($gc6) :LV6_604 if and not Car.Wrecked(6@) not Actor.Dead(8@) else_jump @LV6_282 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// :LV6_283 if and Car.Wrecked(7@) Actor.Dead(9@) then Actor.DestroyInstantly($gc7) Actor.DestroyInstantly($gc8) Actor.DestroyInstantly($gc9) Actor.DestroyInstantly($gc10) end if 056E: car 7@ defined else_jump @LV6_399 if or Car.Wrecked(6@) 8205: not actor $PLAYER_ACTOR near_car 7@ radius 500.0 500.0 500.0 flag 0 else_jump @LV6_392 Car.RemoveReferences(7@) Actor.RemoveReferences(9@) 7@ = 0 9@ = 0 :LV6_392 jump @LV6_605 :LV6_399 Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) 0208: 3@ = random_float_in_ranges 0.0 360.0 02F7: 4@ = cosine 3@ // (float) 02F6: 5@ = sine 3@ // (float) 4@ *= 50.0 5@ *= 50.0 0063: 0@ -= 4@ // (float) 0063: 1@ -= 5@ // (float) 2@ += 50.0 02CE: 2@ = ground_z_at 0@ 1@ 2@ 2@ += 50.0 7@ = Car.Create(#HUNTER, 0@, 1@, 2@) Car.Angle(7@) = 3@ 9@ = Actor.CreateAsDriver(Cop, #ARMY, 7@) Car.ImmuneToNonPlayer(7@, True) 0724: heli 7@ follow_and_attack_player $PLAYER_CHAR altitude_between 30.0 and 0.0 0825: set_helicopter 7@ instant_rotor_start 07BB: set_heli 7@ horizontal_thrust_power 0 04DF: set_heli 7@ lean_and_thrust_limiter 0 Actor.Create($gc7 Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc8 Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc9, Cop, #ARMY, 0@ 1@ 2@) Actor.Create($gc10, Cop, #ARMY, 0@ 1@ 2@) 0337: set_actor $gc7 visibility 0 0337: set_actor $gc8 visibility 0 0337: set_actor $gc9 visibility 0 0337: set_actor $gc10 visibility 0 Actor.SetImmunities($gc7, True, True, True, True, True) Actor.SetImmunities($gc8, True, True, True, True, True) Actor.SetImmunities($gc9, True, True, True, True, True) Actor.SetImmunities($gc10, True, True, True, True, True) 0464: put_actor $gc7 into_turret_on_car 7@ at_car_offset -2.5 4.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 36 0464: put_actor $gc8 into_turret_on_car 7@ at_car_offset 2.5 4.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 36 0464: put_actor $gc9 into_turret_on_car 7@ at_car_offset -2.5 5.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 36 0464: put_actor $gc10 into_turret_on_car 7@ at_car_offset 2.5 5.0 0.0 position 0 shooting_angle_limit 1000.0 with_weapon 36 05E2: AS_actor $gc7 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc8 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc9 kill_actor $PLAYER_ACTOR 05E2: AS_actor $gc10 kill_actor $PLAYER_ACTOR Actor.RemoveReferences($gc7) Actor.RemoveReferences($gc8) Actor.RemoveReferences($gc9) Actor.RemoveReferences($gc10) :LV6_605 if and not Car.Wrecked(7@) not Actor.Dead(9@) jf @LV6_283 jump @LV6_11 Link to comment Share on other sites More sharing options...
Shiro Naomi Posted February 28, 2021 Author Share Posted February 28, 2021 Hi? 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