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. Forum Support

    3. Suggestions

Helicopter gunner mod crash


vlads
 Share

Recommended Posts

The mod seems to be working fine except everytime i got hit by the hydra/jet homing missile directly in the center body of my helicopter were my left and right door gunner stand the game crushes.

 

{$CLEO .cs}

0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 

if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
092B: [email protected] = group $PLAYER_GROUP member 2
092B: [email protected] = group $PLAYER_GROUP member 3
0470: [email protected] = actor [email protected] current_weapon
0470: [email protected] = actor [email protected] current_weapon

if and
056D:   actor [email protected] defined 
056D:   actor [email protected] defined
jf @GUNNER 
if
056E:   car [email protected] defined
jf @GUNNER
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]

0446: set_actor [email protected] dismemberment_possible 0
0446: set_actor [email protected] dismemberment_possible 0

0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100  

0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100

jump @GUNNER

I'm kinda new in scripting so you might find my script very weak. 😅

Link to comment
Share on other sites

Your whole script loops permanently

All codes are repeated and will be executed thousand times per second

 

Add a new loop for the new situation

{$CLEO .cs}

0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 

if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
5@ = Actor.CurrentCar($PLAYER_ACTOR)
092B: 1@ = group $PLAYER_GROUP member 2
092B: 2@ = group $PLAYER_GROUP member 3
0470: 7@ = actor 1@ current_weapon
0470: 8@ = actor 2@ current_weapon

if and
056D:   actor 1@ defined 
056D:   actor 2@ defined
jf @GUNNER 

0464: put_actor 1@ into_turret_on_car 5@ at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 7@
0464: put_actor 2@ into_turret_on_car 5@ at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 8@

0446: set_actor 1@ dismemberment_possible 0
0446: set_actor 2@ dismemberment_possible 0

0638: AS_actor 1@ stay_put 1
099F: AS_actor 1@ ignore_weapon_range 1
07DD: set_actor 1@ attack_rate 100  

0638: AS_actor 2@ stay_put 1
099F: AS_actor 2@ ignore_weapon_range 1
07DD: set_actor 2@ attack_rate 100



:Action_Loop
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @cleanup 
if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @cleanup
if and
0118:   actor 1@ dead
0118:   actor 2@ dead
jf @Action_Loop



:cleanup
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
jump @GUNNER

 

Link to comment
Share on other sites

Thanks for the respond

I did what you tought me i've add a new loops though i'm not sure if i did it right, but the game still crashes.

 

{$CLEO .cs}

0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 

if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
092B: [email protected] = group $PLAYER_GROUP member 2
092B: [email protected] = group $PLAYER_GROUP member 3
0470: [email protected] = actor [email protected] current_weapon
0470: [email protected] = actor [email protected] current_weapon
jump @Actors

:Actors
if and
056D:   actor [email protected] defined 
056D:   actor [email protected] defined
jf @GUNNER 

0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]

0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100 
0223: set_actor [email protected] health_to 9999
 
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100
0223: set_actor [email protected] health_to 9999



:Action_Loop
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @cleanup 
if 
00DD: not  actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
// 05CD: AS_actor $PLAYER_ACTOR exit_car [email protected]
jf @cleanup
if and
0118:   actor [email protected] dead
0118:   actor [email protected] dead
jf @GUNNER



:cleanup
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
jump @GUNNER

However i found out that the direct hit of a homing missile gets the heli gunners killed and their death is real cause the crash

so i gave them a 9999 health so they can't be killed technically and the crash stopped. Though the fact that the gunner can't be killed now is very unrealistic so i'm still looking for any possible way to fix this.

Link to comment
Share on other sites

Try this one, I purposely change their health into 1000 to see if their do not cause a crash

{$CLEO .cs}
0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 
if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
092B: [email protected] = group $PLAYER_GROUP member 2
092B: [email protected] = group $PLAYER_GROUP member 3
if and
056D:   actor [email protected] defined 
056D:   actor [email protected] defined
jf @GUNNER 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
0470: [email protected] = actor [email protected] current_weapon
0470: [email protected] = actor [email protected] current_weapon
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100 
0223: set_actor [email protected] health_to 1000
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100
0223: set_actor [email protected] health_to 1000

:Action_Loop
wait 0 
if and
   Player.Defined($PLAYER_CHAR)
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @cleanup
if and
0118:   actor [email protected] dead
0118:   actor [email protected] dead
jf @Action_Loop

:cleanup
01C3: remove_references_to_car [email protected]
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
wait 500
jump @GUNNER

 

Edited by In45do
Link to comment
Share on other sites

Your script is not working it just remove the reference of my gang member.

By the way i forgot that the script in my last post is not working.

 

This is the working one that is suppose to be in my last post.

{$CLEO .cs}

0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 

if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
092B: [email protected] = group $PLAYER_GROUP member 2
092B: [email protected] = group $PLAYER_GROUP member 3
0470: [email protected] = actor [email protected] current_weapon
0470: [email protected] = actor [email protected] current_weapon
jump @Actors

:Actors
if and
056D:   actor [email protected] defined 
056D:   actor [email protected] defined
jf @GUNNER 

0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]

0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100 
0223: set_actor [email protected] health_to 9999
 
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100
0223: set_actor [email protected] health_to 9999



:Action_Loop
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @cleanup 
if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @cleanup
if and
0118:   actor [email protected] dead
0118:   actor [email protected] dead
jf @GUNNER



:cleanup
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian
jump @GUNNER

 

Just now, vlads said:

Its not working it just remove the reference of my gang member.

By the way i forgot that the script in my last post is not working.

 

This is the working one that is suppose to be in my last post.

{$CLEO .cs}

0000:   "Helicopter Gunner"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 

if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
5@ = Actor.CurrentCar($PLAYER_ACTOR)
092B: 1@ = group $PLAYER_GROUP member 2
092B: 2@ = group $PLAYER_GROUP member 3
0470: 7@ = actor 1@ current_weapon
0470: 8@ = actor 2@ current_weapon
jump @Actors

:Actors
if and
056D:   actor 1@ defined 
056D:   actor 2@ defined
jf @GUNNER 

0464: put_actor 1@ into_turret_on_car 5@ at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 7@
0464: put_actor 2@ into_turret_on_car 5@ at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 8@

0638: AS_actor 1@ stay_put 1
099F: AS_actor 1@ ignore_weapon_range 1
07DD: set_actor 1@ attack_rate 100 
0223: set_actor 1@ health_to 9999
 
0638: AS_actor 2@ stay_put 1
099F: AS_actor 2@ ignore_weapon_range 1
07DD: set_actor 2@ attack_rate 100
0223: set_actor 2@ health_to 9999



:Action_Loop
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @cleanup 
if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @cleanup
if and
0118:   actor 1@ dead
0118:   actor 2@ dead
jf @GUNNER



:cleanup
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian
jump @GUNNER

 

 

Link to comment
Share on other sites

My bad. This one has been tested. Should've working fine.

 

{$CLEO .cs}
:Cam
03A4: name_thread "gunner_test"

:GUNNER
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @GUNNER 
if 
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @GUNNER 
092B: [email protected] = group $PLAYER_GROUP member 2
092B: [email protected] = group $PLAYER_GROUP member 3
if and
056D:   actor [email protected] defined 
056D:   actor [email protected] defined
jf @GUNNER 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
0470: [email protected] = actor [email protected] current_weapon
0470: [email protected] = actor [email protected] current_weapon
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100 
0223: set_actor [email protected] health_to 1000
0638: AS_actor [email protected] stay_put 1
099F: AS_actor [email protected] ignore_weapon_range 1
07DD: set_actor [email protected] attack_rate 100
0223: set_actor [email protected] health_to 1000
[email protected] = 0

:Action_Loop
wait 0 
if and
   Player.Defined($PLAYER_CHAR)
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RAINDANC
jf @cleanup2
if
056D:   actor [email protected] defined
jf @Check2
if
8118:   not actor [email protected] dead
jf @Dead1
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.5 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
jump @Check2

:Dead1
01C2: remove_references_to_actor [email protected]
[email protected] += 1

:Check2
if
056D:   actor [email protected] defined
jf @Check_All
if
8118:   not actor [email protected] dead
jf @Dead2
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.5 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected]
jump @Check_All

:Dead2
01C2: remove_references_to_actor [email protected]
[email protected] += 1

:Check_All
if
[email protected] == 2
jf @Action_Loop

:cleanup
0ACA: show_text_box "RELEASED"
01C3: remove_references_to_car [email protected]
wait 500
jump @GUNNER

:cleanup2
gosub @CheckReturn
jump @cleanup

:CheckReturn
if
056D:   actor [email protected] defined
jf @CheckReturn2
01C2: remove_references_to_actor [email protected]

:CheckReturn2
if
056D:   actor [email protected] defined
jf @return
01C2: remove_references_to_actor [email protected]

:return
return

 

Link to comment
Share on other sites

Thanks men its working and also fixed the bugs in my previews script. But it only works in when i have 4 or more gang member and i have to recruit the gunner again everytime i exit the heli.

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.