For the complete documentation index, see llms.txt. This page is also available as Markdown.

tuff-hud


1. Open the file

Open the following file: tuff-hud/client/bridge/framework/YOUR_FRAMEWORK/client.lua

2. Remove unnecessary code

Find the QBCoreBridge:ApplyPlayerData function and delete the entire section on hunger, thirst, and stress.

if PlayerData.metadata then
    if PlayerData.metadata.hunger ~= nil then Client.PlayerData.Hunger = math.floor(PlayerData.metadata.hunger) end
    if PlayerData.metadata.thirst ~= nil then Client.PlayerData.Thrist = math.floor(PlayerData.metadata.thirst) end
    if not Settings.DisableStress and Settings.FrameworkSystems and PlayerData.metadata.stress ~= nil then
        Client.PlayerData.Stress = math.floor(PlayerData.metadata.stress)
    end
end

Find the QboxBridge:ApplyPlayerData function and delete the entire section on hunger, thirst, and stress.

if PlayerData.metadata then
    if PlayerData.metadata.hunger ~= nil then
        Client.PlayerData.Hunger = math.floor(PlayerData.metadata.hunger)
    end
    
    if PlayerData.metadata.thirst ~= nil then
        Client.PlayerData.Thrist = math.floor(PlayerData.metadata.thirst)
    end
    
    if not Settings.DisableStress and Settings.FrameworkSystems and PlayerData.metadata.stress ~= nil then
        Client.PlayerData.Stress = math.floor(PlayerData.metadata.stress)
    end
end

3. Modify code

Find the ESXBridge:StartStatusListener function and replace with the following:

function ESXBridge:StartStatusListener(Client, Settings, refreshPlayerData)
    AddStateBagChangeHandler("hunger", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Hunger = percentage
    end)

    AddStateBagChangeHandler("thirst", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Thrist = percentage
    end)

    AddStateBagChangeHandler("stress", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Stress = percentage
    end)
end

Find the QBCoreBridge:StartStatusListener function and replace with the following:

function QBCoreBridge:StartStatusListener(Client, Settings, refreshPlayerData)
    AddStateBagChangeHandler("hunger", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Hunger = percentage
    end)

    AddStateBagChangeHandler("thirst", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Thrist = percentage
    end)

    AddStateBagChangeHandler("stress", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
        Client.PlayerData.Stress = percentage
    end)
end

Find the QboxBridge:StartStatusListener function and replace with the following:

Last updated