Permanent fix for Female (Ped) HP IN ALL HUDS

Specifically made this fix for Kato, saw his thread and its typical to see no responses after a few days… This community lol.

  • Reply if you need help
    With your specific hud, whether it’s trew hud, np hud, qbus hud, flat hud, esx_hud, kl_hud, ln-hud, unknownlife_hud, nzy-hud, etc; disclaimer, most of the huds you download in public are already going to have this fix implemented, which is typically invisible to the naked eye for new server developers/creators!
    Health in the HUD BEFORE the change https://prnt.sc/ugod2g
    Code BEFORE the change https://prnt.sc/ugoe4l

Health in the HUD AFTER the change https://prnt.sc/ugoeld
Code AFTER the change https://prnt.sc/ugof9e

tl;dr

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1)
				if GetEntityMaxHealth(GetPlayerPed(-1)) ~= 200 then
			SetEntityMaxHealth(GetPlayerPed(-1), 200)
			SetEntityHealth(GetPlayerPed(-1), 200)
		end

If you need help putting this where it needs to be, just reply here, If I can’t get to you then I’m sure someone else who used this fix can help you :slight_smile:
This is the proper way, other post’s I’ve read, didn’t really explain it much when I first got started, but since then I haven’t had any issues with this way of doing it, just make sure its at the top of where your huds Citizen.CreateThread(function() is declared after the while true do statement, the screenshots will explain it if you’re new, just reference those and see how your code is, compare it and see how you can implement this simple block into your own hud’s code. :slight_smile: <3

4 Likes

this is the code for enzy-hud


Were do I put the Code ? :slight_smile:

Also thank you for the help. <3

1 Like

–General UI Updates

Citizen.CreateThread(function()
    Citizen.Wait(0)
    SendNUIMessage({
        action = 'showui'
    })

    while true do
		if GetEntityMaxHealth(GetPlayerPed(-1)) ~= 200 then
			SetEntityMaxHealth(GetPlayerPed(-1), 200)
			SetEntityHealth(GetPlayerPed(-1), 200)
		end
        local player = PlayerPedId()

        SendNUIMessage({
            action = 'tick',
            show = IsPauseMenuActive(),
            health = (GetEntityHealth(player) - 100),
            armor = GetPedArmour(player),
            stamina = 100 - GetPlayerSprintStaminaRemaining(PlayerId()),
            --stamina = 25 + GetPlayerUnderwaterTimeRemaining(PlayerId()),
        })
        Citizen.Wait(200)
    end
end)
3 Likes

You’re a Legend Dude !

1 Like

But then all PEDs have 200 HP when connecting, right? Even if they were hurt, or am I thinking wrong?

1 Like

Amazing. Thanks!

will this make the female ped to look like that in the picture

@DevBear

1 Like

I did this a long time ago :slight_smile:

It’s maybe only on the dev branch though

2 Likes

Did you figure out how to fix it?

hello,I need some help:(
I don’t know where do i put the Code:(

Citizen.CreateThread(function()
    while loaded == false do
        Citizen.Wait(300)
    end

    while true do 
        Citizen.Wait(300)
        local ped =  GetPlayerPed(-1)
        local playerId = PlayerId()
        SetPlayerHealthRechargeMultiplier(playerId, 0)
        local pedhealth = GetEntityHealth(ped)

        if pedhealth < 100 then
          health = 0
        else
          pedhealth = pedhealth - 100
          health    = pedhealth
        end
        
        armor = GetPedArmour(ped)
        oxygen = GetPlayerUnderwaterTimeRemaining(playerId)*10
        oxygen = math.ceil(oxygen)
        SendNUIMessage({
            type = "update",
            id = id,
            health = health,
            armor = armor,
            food = food,
            water = water,
            oxygen = oxygen,
            job = job,
            jobgrade = jobgrade,
            socBal = socBal,
        })
    end
end)

where get this Beautiful lines of code in the threw hud?

Where to put lines in qb-hud?

Now dont work, I’m using ESX_Legacy n.n

Anyone have the fix for
PS-HUD?

1 Like

this^

I would also like to know if there is a fix for this for PS-HUD. I’m also using QB-Core

any update for ps-hud?

Ok, I find solution for my last error in ESX Legacy but now, the problem is… When u reconnect, u have full hp, so players can use this for abuse xd