QB The problem of players resurrecting and recovering from hunger to full

QB When a player dies and becomes fully hungry after resurrection, how to keep them as they are

What ambulance script are you using.

QB comes with
qb-ambulancejob

If you want to make it to where players food and thirst levels are not set to maximum whenever they are revived then go to:

qb-ambulancejob > client > main.lua

Then find the local function called “ResetAll()” (should be at around line 205) and replace that entire function with this:


local function ResetAll()
    isBleeding = 0
    bleedTickTimer = 0
    advanceBleedTimer = 0
    fadeOutTimer = 0
    blackoutTimer = 0
    onDrugs = 0
    wasOnDrugs = false
    onPainKiller = 0
    wasOnPainKillers = false
    injured = {}

    for _, v in pairs(BodyParts) do
        v.isDamaged = false
        v.severity = 0
    end

    TriggerServerEvent('hospital:server:SyncInjuries', {
        limbs = BodyParts,
        isBleeding = tonumber(isBleeding)
    })

    CurrentDamageList = {}
    TriggerServerEvent('hospital:server:SetWeaponDamage', CurrentDamageList)

    ProcessRunStuff(PlayerPedId())
    DoLimbAlert()
    DoBleedAlert()

    TriggerServerEvent('hospital:server:SyncInjuries', {
        limbs = BodyParts,
        isBleeding = tonumber(isBleeding)
    })
  
end

This will make it to where the players food and thirst levels are not set to max whenever the player is revived however if an admin uses the /revive command or the txadmin revive then it will give them max food/water. This fix only makes it to where non admin ways of reviving the player does not give the player max food or water.

1 Like

Solved it, thank you very much

1 Like

No problem!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.