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

Code bug


suliman2
 Share

Recommended Posts

Hi

 

My threads are set up and are run ingame. The first works and controls health. The second should set armour to 50 if its above 50. Problem is it sets it to 50 (once) after wasted/busted/start of game. Like the "if" doesnt work properly all the time. What could be wrong? The first one works like a charm.

 

Oh and is it confirmed that you cannot lower max_health only increase it? I would want the healthbar to be shorter so that 50 health looks like full-health (not half bar empty as it is now). Playing around with max_health doesnt work.

 

Thanks. My code:

 

 

:LOWHEALTH

0001: wait 250 ms

00D6: if 0

0256: defined $PLAYER_CHAR

004D: jump_if_false ££LOWHEALTH

0226: @0 = actor $PLAYER_ACTOR health

00D6: if 0

0019: @0 > 50 ;; integer values

004D: jump_if_false ££LOWHEALTH

0223: set_actor $PLAYER_ACTOR health_to 50

0002: jump ££LOWHEALTH

 

 

 

 

:LOWARMOUR

0001: wait 250 ms

00D6: if 0

0256: defined $PLAYER_CHAR

004D: jump_if_false ££LOWARMOUR

0226: @0 = actor $PLAYER_ACTOR armour

00D6: if 0

0019: @0 > 50 ;; integer values

004D: jump_if_false ££LOWARMOUR

035F: set_actor $PLAYER_ACTOR armour_to 50

0002: jump ££LOWARMOUR

Link to comment
Share on other sites

It would appear that you believe the text is interpreted by the game. It isn't. The armor code checks on health since you used opcode 0226. Also, if you'll check the Opcode Database, you'll find that I dutifully named 035F as INCREMENT_actor_armor (not SET) because after testing, that's what it does, despite you renaming it set for whatever reason.

 

I don't know about the max. You say bar, so I'm assuming we're talking SA here. I know in VC (where the opcode to change max first appeared), it was an increment command whereby using -50 for example should work fine. Maybe you were just trying the wrong opcode and naming it to suit what you WANTED it to do tounge.gif

Link to comment
Share on other sites

i do not really get the idea why full bar does not work. use this you can edit regarding to info after semicolons

 

:ARMREG00

0001: wait 1000 ms ;checks every second

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££ARMREG00

0653: @0 = stat 24 (max health) ; float

0013: @0 *= 1.75 ;; floating-point values

0A1F: set_stat 24 max_to @0

04DD: @0 = actor $PLAYER_ACTOR armour

0226: @2 = actor $PLAYER_ACTOR health

0945: $PLAYER_CHAR @1

0016: @1 /= 2 ;; integer values ;2 means 1/2 of armour bar, 1 would be full bar

00D6: if 0

002D: @1 >= @0 ;; integer values

004D: jump_if_false ££ARMREG01

0062: @1 -= @0 ;; integer values

035F: set_actor $PLAYER_ACTOR armour_to @1

 

:ARMREG01

00D6: if 0

8019: NOT @2 > 87 ;; integer values ;87 means refill when less than 88 (174 would be full health bar)

004D: jump_if_false ££ARMREG00

0223: set_actor $PLAYER_ACTOR health_to 88 ;here 88 for 1/2 healths bar or 175 for full

0002: jump ££ARMREG00

004E: end_thread

Edited by PLPynton
Link to comment
Share on other sites

 

Hi

 

My threads are set up and are run ingame. The first works and controls health. The second should set armour to 50 if its above 50. Problem is it sets it to 50 (once) after wasted/busted/start of game. Like the "if" doesnt work properly all the time. What could be wrong? The first one works like a charm.

 

Oh and is it confirmed that you cannot lower max_health only increase it? I would want the healthbar to be shorter so that 50 health looks like full-health (not half bar empty as it is now). Playing around with max_health doesnt work.

 

Thanks. My code:

 

 

:LOWHEALTH

0001: wait  250 ms

00D6: if  0

0256:  defined $PLAYER_CHAR

004D: jump_if_false ££LOWHEALTH

0226: @0 = actor $PLAYER_ACTOR health

00D6: if  0

0019:  @0 >  50 ;; integer values

004D: jump_if_false ££LOWHEALTH

0223: set_actor $PLAYER_ACTOR health_to  50

0002: jump ££LOWHEALTH   

 

 

 

 

:LOWARMOUR

0001: wait  250 ms

00D6: if  0

0256:  defined $PLAYER_CHAR

004D: jump_if_false ££LOWARMOUR

0226: @0 = actor $PLAYER_ACTOR armour

00D6: if  0

0019:  @0 >  50 ;; integer values

004D: jump_if_false ££LOWARMOUR

035F: set_actor $PLAYER_ACTOR armour_to  50

0002: jump ££LOWARMOUR

You must change the "if bigger"-code

 

:body1_30001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ££body1_60226: @21 = actor $PLAYER_ACTOR health04DD: @22 = actor $PLAYER_ACTOR armour00D6: if  0001B:    30 > @22 ;; integer values004D: jump_if_false ££body1_4055F: set_player $PLAYER_CHAR max_armour +=  70:body1_400D6: if  0001B:    30 > @21 ;; integer values004D: jump_if_false ££body1_44055E: set_player $PLAYER_CHAR max_health +=  70

 

 

for bigger full max health and extra full max health exists more codes

search it tounge.gif

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.