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

health bar


TheJeweleR
 Share

Recommended Posts

hi guys.I make a new my mod.

 

Description

 

When you drove you car you saw a you car's health bar..

 

I can create it but it isn't down or up.It everytime set.

 

How can i make it?

 

I want: If somebody hit your car,Your car health down. etc. confused.gif

 

As if the dynamic object...

 

Link to comment
Share on other sites

 

Have a look at this tutorial. smile.gif

very thanks man.I don't look all topics because i cant speak perfect english biggrin.gif

 

I didn't understand that lessons :S (only status bar )

 

can you make dinamic bar for me? please..

 

my codes

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'bar' :SWEET4_47Model.Load(#GREENWOO)038B: load_requested_models:SWEET4_103if not Model.Available(#GREENWOO)else_jump @SWEET4_152wait 0jump @SWEET4_103:[email protected] = [email protected] = [email protected] = [email protected] = 16.00395: clear_area 1 at [email protected] [email protected] [email protected] range [email protected] = Car.Create(#GREENWOO, [email protected], [email protected], [email protected])0229: set_car [email protected] color_to 59 34Car.Angle([email protected]) = [email protected]([email protected]) = 1450$health = Car.Health([email protected])wait 0 ms$health = Car.Health([email protected])0084: $health2 = $health // integer values and handlesif$health2 > 250 // integer valueselse_jump @SWEET4_11472$health2 -= 250 // integer values:SWEET4_11472$health2 /= 12 // integer valuesif  $health < 250jf @SWEET4_114720151: remove_status_text $health2end_thread

 

Link to comment
Share on other sites

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP 03A4: name_thread 'TESTBAR' 0007: [email protected] = 2508.16 0007: [email protected] = -1666.47 0007: [email protected] = 13.0 :TESTBAR_430001: wait 10 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @TESTBAR_43 00D6: if 03EE:   player $PLAYER_CHAR controllable 004D: jump_if_false @TESTBAR_43 00D6: if 0038:   $ONMISSION == 0 004D: jump_if_false @TESTBAR_43 00D6: if 00EC:   actor $PLAYER_ACTOR 0 near_point [email protected] [email protected] radius 80.0 80.0 004D: jump_if_false @TESTBAR_43 0050: gosub @TESTBAR_319 0395: clear_area 1 at [email protected] [email protected] [email protected] radius 6.0 00A5: [email protected] = create_car #GREENWOO at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 59 secondary_color_to 34 0175: set_car [email protected] Z_angle_to [email protected] :TESTBAR_1900001: wait 10 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @TESTBAR_302 00D6: if 00DB:   actor $PLAYER_ACTOR in_car [email protected] 004D: jump_if_false @TESTBAR_302 00D6: if 8119:   not car [email protected] wrecked 004D: jump_if_false @TESTBAR_302 0227: $CARHEALTH = car [email protected] health 0014: $CARHEALTH /= 10 03C4: set_status_text $CARHEALTH type 1 GXT 'SWE4_08' // global_variable  // CAR HEALTH00D6: if 001A:   200 > $CARHEALTH 004D: jump_if_false @TESTBAR_302 0002: jump @TESTBAR_190 :TESTBAR_3020151: remove_status_text $CARHEALTH 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0002: jump @TESTBAR_43 :TESTBAR_3190247: load_model #GREENWOO :TESTBAR_3240001: wait 10 ms 00D6: if 0248:   model #GREENWOO available 004D: jump_if_false @TESTBAR_353 0051: return :TESTBAR_3530002: jump @TESTBAR_324 

 

 

havn't teted it yet

Edited by The_Siggi
Link to comment
Share on other sites

You should test your codes before posting it.

 

First, if you do it like this, it won't work at all. You have to change this:

 

00D6: if00DB:   actor $PLAYER_ACTOR in_car [email protected]: jump_if_false @TESTBAR_302

 

 

Into:

 

00D6: if00DB:   actor $PLAYER_ACTOR in_car [email protected]: jump_if_false @TESTBAR_190

 

 

But after this, it is working only when you are inside that car! So if someone shoots at you, or (for test purposes) you will get out of the car and hit it, the bar stays the same (until you get in the car, then it will go immediately to the right health).

The most simple solution for this problem is to move the check if the player is in the car, before the loop where you check the health of the car.

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.