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

high end struct


Bad.boy!
 Share

Recommended Posts

I'm having problem with high end struct, especially with while true.

My code doesn't compile:

 

 

{$CLEO .cs}thread 'HARDER':HARDERrepeatwait 0until Player.Defined($PLAYER_CHAR)repeatwait [email protected] = Player.WantedLevel($PLAYER_CHAR)until [email protected] == 6if   Actor.Driving($PLAYER_ACTOR)   then       if           Actor.DrivingPlane($PLAYER_ACTOR)           then               Model.Load(#ARMY)               Model.Load(#HYDRA)               while true               wait 0               if and                   Model.Available(#ARMY)                   Model.Available(#HYDRA)                   then                       [email protected] = 2                       04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 50.0 50.0                       [email protected] = Car.Create(#HYDRA, [email protected], [email protected], [email protected])                       0745: set_hydra [email protected] thrust_to_horizontal                       08E6: set_plane [email protected] landing_gear 0                       0742: unknown_plane [email protected] unknown_set 0.5                        08A2: set_hydra [email protected] attack_with_rockets_car_of_player $PLAYER_CHAR radius 30.0                        04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 50.0 50.0                       [email protected] = Car.Create(#HYDRA, [email protected], [email protected], [email protected])                       0745: set_hydra [email protected] thrust_to_horizontal                       08E6: set_plane [email protected] landing_gear 0                       0742: unknown_plane [email protected] unknown_set 0.5                        08A2: set_hydra [email protected] attack_with_rockets_car_of_player $PLAYER_CHAR radius 30.0                        0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                       0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                       0249: release_model #ARMY                       0249: release_model #HYDRA                       while true                       wait 0                       gosub @CHECK                       if and                           Car.Wrecked([email protected])                           Car.Wrecked([email protected])                           then                               gosub @CLEANUP                               jump @HARDER                       end               end           else           Model.Load(#ARMY)           Model.Load(#HUNTER)           while true           wait 0           if and               Model.Available(#ARMY)               Model.Available(#HUNTER)               then                   [email protected] = 1                   04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 50.0 50.0                   [email protected] = Car.Create(#HUNTER, [email protected], [email protected], [email protected])                   0841: flying_vehicle [email protected] use_secondary_gun 1                   0724: heli [email protected] follow_and_attack_player $PLAYER_CHAR radius 50.0                   04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 50.0 50.0                   [email protected] = Car.Create(#HUNTER, [email protected], [email protected], [email protected])                   0841: flying_vehicle [email protected] use_secondary_gun 0                   0724: heli [email protected] follow_and_attack_player $PLAYER_CHAR radius 50.0                   0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                   0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                   0249: release_model #ARMY                   0249: release_model #HUNTER                   while true                   wait 0                   gosub @CHECK                   if and                       Car.Wrecked([email protected])                       Car.Wrecked([email protected])                       then                           gosub @CLEANUP                           jump @HARDER                   end           end       end   else //  <-- PROBLEM       jump @HARDERend:CHECKwait [email protected] = Player.WantedLevel($PLAYER_CHAR)if   [email protected] == 6   then       if           [email protected] == 2           then               if                   Actor.DrivingPlane($PLAYER_ACTOR)                   then                       return                   else                       gosub @CLEANUP                       jump @HARDER               end           else               if                   [email protected] == 1                   then                       if and                           not Actor.DrivingPlane($PLAYER_ACTOR)                           Actor.Driving($PLAYER_ACTOR)                           then                               return                           else                               gosub @CLEANUP                               jump @HARDER                       end               end       end   else       jump @CLEANUP       jump @HARDERend               :CLEANUPCar.RemoveReferences([email protected])Car.RemoveReferences([email protected])Actor.RemoveReferences([email protected])Actor.RemoveReferences([email protected])return

 

Link to comment
Share on other sites

spaceeinstein

When using high end structure, make sure you line up the if..then...else...end so that you can find errors more easily.

 

 

if Actor.Driving($PLAYER_ACTOR)then   if       Actor.DrivingPlane($PLAYER_ACTOR)   then       Model.Load(#ARMY)       Model.Load(#HYDRA)       while true           wait 0           if and               Model.Available(#ARMY)               Model.Available(#HYDRA)           then               [email protected] = 2               04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 50.0 50.0               [email protected] = Car.Create(#HYDRA, [email protected], [email protected], [email protected])               0745: set_hydra [email protected] thrust_to_horizontal               08E6: set_plane [email protected] landing_gear 0               0742: unknown_plane [email protected] unknown_set 0.5               08A2: set_hydra [email protected] attack_with_rockets_car_of_player $PLAYER_CHAR radius 30.0               04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 50.0 50.0               [email protected] = Car.Create(#HYDRA, [email protected], [email protected], [email protected])               0745: set_hydra [email protected] thrust_to_horizontal               08E6: set_plane [email protected] landing_gear 0               0742: unknown_plane [email protected] unknown_set 0.5               08A2: set_hydra [email protected] attack_with_rockets_car_of_player $PLAYER_CHAR radius 30.0               0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat               0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat               049: release_model #ARMY               0249: release_model #HYDRA               while true                   wait 0                   gosub @CHECK                   if and                       Car.Wrecked([email protected])                       Car.Wrecked([email protected])                   then                       gosub @CLEANUP                       jump @HARDER                   end               end           else               Model.Load(#ARMY)               Model.Load(#HUNTER)               while true                   wait 0                   if and                       Model.Available(#ARMY)                       Model.Available(#HUNTER)                   then                       [email protected] = 1                       04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 50.0 50.0                       [email protected] = Car.Create(#HUNTER, [email protected], [email protected], [email protected])                       0841: flying_vehicle [email protected] use_secondary_gun 1                       0724: heli [email protected] follow_and_attack_player $PLAYER_CHAR radius 50.0                       04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 50.0 50.0                       [email protected] = Car.Create(#HUNTER, [email protected], [email protected], [email protected])                       0841: flying_vehicle [email protected] use_secondary_gun 0                       0724: heli [email protected] follow_and_attack_player $PLAYER_CHAR radius 50.0                       0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                       0129: [email protected] = create_actor_pedtype 7 model #ARMY in_car [email protected] driverseat                       0249: release_model #ARMY                       0249: release_model #HUNTER                       while true                           wait 0                           gosub @CHECK                           if and                               Car.Wrecked([email protected])                               Car.Wrecked([email protected])                           then                               gosub @CLEANUP                               jump @HARDER                           end                       end                   end               else //  

 

As you can see, now that it's lined up (I think I did that right), you're missing a few ends there. The problem area is that you didn't end the while loop.

Edited by spaceeinstein
Link to comment
Share on other sites

Thanks for the help, my script works.

 

I don't know if everyone already knows what this opcode means:

 

0742: unknown_plane [email protected] unknown_set 0.5

 

 

But I just found out that if the value is set 0.5 and use opcode 08A2 (hydra attacks with rockets), the hydra will shoot heetseakers instead of normal rockets.

Link to comment
Share on other sites

 

Thanks for the help, my script works.

 

I don't know if everyone already knows what this opcode means:

 

0742: unknown_plane [email protected] unknown_set 0.5

 

 

But I just found out that if the value is set 0.5 and use opcode 08A2 (hydra attacks with rockets), the hydra will shoot heetseakers instead of normal rockets.

I used that code as I made a script where Hydras are shooting throw San Fierro Downtown >click<

It's an x_angle, the Hydra lifts up with 17.5 after removeing reference and continues flying like an Aerobatics

Link to comment
Share on other sites

Strange, because withouth that opcode hydra's don't shoot heatseekers, at all. And if I increase the number from 0.5 to 1.0 the rockets are stronger heatseeking.

 

Also the mission where the opcode was originally used (with hydra, from vertical bird):

 

0742: unknown_plane [email protected]([email protected],3i) unknown_set 0.5 08A2: set_hydra [email protected]([email protected],3i) attack_with_rockets_car_of_player $PLAYER_CHAR radius 30.0 

 

 

 

Another mission (zero, rc sh*t):

 

04D2: set_plane [email protected]([email protected],10i) fly_autopilot_around_point [email protected]([email protected],4f) [email protected]([email protected],4f) [email protected] altitude_between -1.0 and 13.5 0742: unknown_plane [email protected]([email protected],10i) unknown_set -0.8 

 

 

The code might just do both, but I think it's about the contex where it is written. Because in the first example, the heatseek would make more sense than aerobatics. But in the second script, the heatseek doesn't make any sense at all. You can test it yourself Hydra's won't launch heatseekers withouth that code.

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.