-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hpbar on hud is not compatible visually with MAX_HEALTH stat #3807
Comments
I also mentioned it here: #3791 (comment) |
https://i.imgur.com/HLln4VA.png https://i.imgur.com/h0HD2YL.png @FileEX On the second pic I tested what happens when I slap myself (-10HP) and as you can see I have 190HP with a full hp bar. The hpbar maximises at 173 hp visually for me on 1920x1080 (idk if screensize matters) btw I don't even understand the 176 as well as 200 hp where these comes from since in the singleplayer the maximum hp was 150 and you could get them the way I mentioned in the first post. I can only think of having 200hp because of the armor here in MTA can not be set to 150 |
Probably it's a bug in MTA that allows setting 200 HP, while the maximum can only be 176.
190 HP shows a full health bar because the width of the bar (progress) is calculated relative to the maximum value of 176, not 200. So, anything above 176 will always be displayed as 100%.
MAX_HEALTH after setting setPedStat(getPlayerFromName('derxgbb'), 24, 1000) is 176, not 150 — even in single player |
So I had some time today and tested these things in singleplayer by using a mod which displays hp and armor in numbers. It seems that after completing the paramedic side mission & saving the game the maxhp will be 176. I was curious about the armor. I only knew that 150 armor should work on all PC versions except an older version of the steam ports. If we analyze the other 3D era GTA games then we can see normal rounded numbers as max hp and armor so IDK why Rockstar went with 176 in GTA:SA In GTA:SA seems like Rockstar messed up some things. The maximum hp should be 150, earning it by paramedic or by exercising. Normally a hooker should increase your hp above the maximum and we should see that in action, for some reason this doesn't work. I checked GTA:SA DE as well. So by a conclusion, I don't know how this problem should be fixed. I don't know if MTA should go with 150 max hp from now, with the hpbar optimised to 150. There is another bug, reported in #3791 which says that you can set your armor on clientside to one million if you'd want to. |
Generally speaking, the correct value is 176, and that's how it should be everywhere, but I'm afraid that at this point it would require changes in many parts of the code, which could potentially conflict with backward compatibility. So, I think the least intrusive solution would be to adjust the HP bar to handle a maximum of 200 HP instead of 176 |
Okay |
Describe the bug
Hello!
I came to report a bug which I'm sure existed for years. I don't know if this bug wasn't noticed or it isn't fixable. I searched about it on github but maybe it was a report on mantis who knows.
In the singleplayer the hpbar is dinamically growing by the fact that CJ exercises his body. It grows to a maximum of 150 hp. This can also be achieved by doing the paramedic missions.
The hpbar is designed to show hp between 0 and 150.
However in MTA for some reason we have maximum hp of 200. (possibly because we can't set armor to have 150 maximum armor, but it is just my accusation)
Steps to reproduce
Launch a local server and observe the hpbar after executing some commands.
first get the current value of MAX_HEALTH it will be useful when resetting:
derxgbb executed command: getPedStat(getPlayerFromName("derxgbb"),24)
Command results: 569 [number]
Now set it to 1000 so the hpbar will get its maximum width.
derxgbb executed command: setPedStat(getPlayerFromName("derxgbb"), 24, 1000)
Command results: true [boolean]
By default we have 100hp with a maximum of 200 now. The hp on the bar is 'kinda' in the middle as it should.
Now set the hp to 150
derxgbb executed command: setElementHealth(getPlayerFromName("derxgbb"),150)
Command results: true [boolean]
It will look like its almost full, but there is still 50hp left.
Now set it to 173.
derxgbb executed command: setElementHealth(getPlayerFromName("derxgbb"),173)
Command results: true [boolean]
With 173hp it maximises and the 27hp which is left till 200 is not shown.
Version
It happens on all versions for years.
Currently:
Server & Client: 22771
Additional context
No response
Relevant log output
No response
Security Policy
The text was updated successfully, but these errors were encountered: