Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Problem in respawn a hunter after destroy


Shiro Naomi
 Share

Recommended Posts

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

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
 Share

  • 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.