GetEntityHealth on the server-side returns an incorrect value
-
Client (production/canary) and FXServer version
Canary / FXServer 4162 / CitizenFX.Core.Server.1.0.4163 -
What you expected to happen
In my case, GetEntityHealth on the server should have returned 400, but it returned 200.
That’s because I set players’ max health to 400, and the health bar was full and GetEntityHealth returned 400 on the client. -
What actually happens
When the player’s health is 100% full, it returns 200 on the server, regardless of the actual max health, but if it’s even a small bit below full health, then it returns the correct value, e.g. 395.
-
Category of bug (eg. client, server, weapons, peds, native)
Natives -
Reproducible steps, preferably with example script(s)
- set player’s max health to 400
- set player’s health to max (400)
- print the result of GetEntityHealth on the server
- set player health to something below, let’s say 350
- print again
In the first case, it prints 200, but in any other case it returns the correct value.