Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Catwaii

[HELP] Making a Vertical HP Car Bar

Recommended Posts

Catwaii

Hello, there.

 

I wanted to make a cleo, which could show the life of the car on a vertical bar.

 

From an existing one (since I don't have the slightest idea of programming in cleo).

 

And after, like, 6 hours, I didn't manage to do anything.

 

The bar keeps moving upwards without any sense, or sometimes it doesn't even appear.

 

So, if there is any kind soul who would like to offer me help, and enlighten me about it. Thank you very much.

 

It wouldn't be bad to have a script just to configure the position in the .ini.

 

Thank you.

 

Example: http://prntscr.com/ojcszy

 

Original Script: https://www.gtaall.net/gta-san-andreas/cleo/53582-indicator-hp-car.html

Share this post


Link to post
Share on other sites
Catwaii

bump

Share this post


Link to post
Share on other sites
ZAZ
Posted (edited)

please don't bump after waiting 2 hours

the link at prntscr.com needs registration to can download

the download at gtaall.net contains a install exe

 

the positioning of the bar is very difficult, because it needs new adjustments, always when the bar get smaller

 

test the templates below

1.) TXD_Bar script shows player_health by displaying texture with opcode 038D:

2.) Draw_Box_Status_Bar script shows car health by displaying draw_box with opcode 038E:

 

{$CLEO .cs}
:TXD_Bar_1
03A4: name_thread 'STSB'

:TXD_Bar_4
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @TXD_Bar_4
0390: load_txd_dictionary 'LD_DUAL' 
038F: request_texture "Health" as  1  // Load dictionary with 0390 first
038F: request_texture "black" as  2  // Load dictionary with 0390 first
wait 500

:TXD_Bar_16
wait 0
if
0256:   player $PLAYER_CHAR defined
jf @TXD_Bar_32
0226: 11@ = actor $PLAYER_ACTOR health
0093: 11@ = integer 11@ to_float
0087: 12@ = 11@  // floating-point values only
0013: 12@ *=  1.5  // floating-point values
0013: 11@ *=  0.8  // floating-point values
0007: 13@ =  450.0  // floating-point values
0063: 13@ -= 11@  // floating-point values
03F0: text_draw_toggle  1
038D: draw_texture 2 position 300.0  21.0 size 304.0  14.0 RGBA 180  180  180  255 
038D: draw_texture 1 position 13@  20.0 size 12@  10.0 RGBA 180  180  180  255 
jump @TXD_Bar_16

:TXD_Bar_32
03F0: toggle_text_draw 0
jump @TXD_Bar_4

 

{$CLEO .cs}
:Draw_Box_Status_Bar
03A4: name_thread 'DBS_BAR'
 

:BAR_1
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
jf @BAR_1
if
00DF:   actor $PLAYER_ACTOR driving 
jf @BAR_1
03C0: 0@ = actor $PLAYER_ACTOR car
0007: 24@ =  625.5  // floating-point values 
30@ = 0.0

:BAR_3
wait 0
if  and
00DF:   actor $PLAYER_ACTOR driving
8119:   not car 0@ wrecked  
jf @BAR_1


0227: 1@ = car 0@ health
008F: 2@ = integer 1@ to_float

2@ *= 0.064
if
0025:   30@ > 2@ // (float)
jf @BAR_7
0087: 29@ = 2@
29@ /= 2000.0
0063: 24@ -= 29@ // (float)
jump @BAR_9

:BAR_7
if
0025:   2@ > 30@ // (float)
jf @BAR_9
0087: 29@ = 2@
29@ /= 2000.0
005B: 24@ += 29@ // (float)


:BAR_9
0087: 30@ = 2@  // floating-point values only
0087: 22@ = 21@  // floating-point values only
0013: 22@ *=  1.4  // floating-point values
0013: 21@ *=  0.7  // floating-point values
0063: 23@ -= 21@  // floating-point values
03F0: enable_text_draw 1  
038E: draw_box_position 580.0 430.0 size 94.0 14.0 RGBA 0 0 0 255  
038E: draw_box_position 580.0 430.0 size 88.0 8.0 RGBA 170 170 170 255
038E: draw_box_position 23@ 430.0 size 22@ 8.0 RGBA 255 0 0 255
0087: 21@ = 2@
0087: 23@ = 24@
jump @BAR_3

 

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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