SetEntityHealth it's not working as it should


  1. Client (production/canary) and FXServer version
    Client 2612 - canary

  2. What you expected to happen
    When I set the health lower than 100, the player remains alive according to the GetEntityHealth doc where PLAYER is 0-200

  3. What actually happens
    When set to 99 or less the player goes to 0 health and is instantly killed!

  4. Category of bug (eg. client, server, weapons, peds, native)

  5. Reproducible steps, preferably with example script(s)

RegisterCommand("tomardano", function(source, args)
        SetEntityHealth(GetPlayerPed(-1), tonumber(args[1]))

execute command /tomardano 99

player is dead!

Thank you ! :slight_smile:

Seems like SetEntityHealth is a bit discriminating, might be your issue?



Come on, I agree with you on his description! But in female ped this also occurs!

So if I were to get this description MALE would be > 100 and FEMALE would be > 0 what happens is that FEMALE also dies below 99!

So we went to the description of GetEntityHealth he says the following:

  • Player [0 to 200]
  • Ped [100 to 200]

So being PLAYER from 0 to 200 and PED from 100 to 200!

So, I interpret that the life in case of ped would be killed below 100 but if it was a player, it would be killed in 0 agree?

It considers everything as PED (which would be from 100 to 200) but then the description would be incorrect from native (of both) or something is incorrect!

IIRC the female mp ped model is considered a male ped model, you can check this with IsPedMale. Also try to give yourself a ped model that is actually considered female and try it again.

If we were to change the docs then we need to figure this whole thing out first.

Good morning, I performed the requested tests on the following peds


All of them on IsPedMale returned as male (true)! In the same way that everyone fell in the 100-200 effecting the death in 99!

We did the animal PED test too and guess what… it returned TRUE on IsPedMale too!

So so far we have the following problems detected

1 - IsPedMale is recognizing everything as MALE

2 - Dead Player which should be 0 - 200 is considering as ped 100 - 200! With this SetEntityHealth at 100- kills the player, which this shouldn’t happen (as per GetEntityHealth doc)

I see, that’s interesting.

Also came by this: FiveM Sexism .. again .. aka IS_PED_MALE - #4 by 7068a60366d255ff13ad
Somehow on network play IsPedMale always returns true?, if that’s the case then singleplayer might be the next thing to test, e.g.: see if the values are indeed relative to the IsPedMale results.