Setup

Steps for setting up your zyke_status resource.

ESX Guide

  • Run the SQL query located in zyke_status/extras/zyke_status.sql.

  • Remove your old esx_status resource from the server, and make sure it does not get started in your server.cfg.

  • Start zyke_status after zyke_lib, but before all resources that would depend on the status system. By default, this would only be esx_basicneeds (or similar) and your hud it has to be above of.

QBCore Guide

For QBCore, it is slightly more complicated because of their setup. The exact steps and lines may differ based on your version and your hud of choice, but the events we need to remove are usually the same.

We offer two approaches, depending on if you want QB to still handle some values, or completely rely on our system. However, we do recommend that you follow the "Full Control" giode so that there are no duplicate drains/effects etc.

Basic Compatibility

To get the basic compatibility going, you will need to modify the SetMetaData function. This allows us to catch any attempts to modify your status, which then dispatch it to our system to handle the rest. Our system will execute everything needed for the rest of your server to proceed as normal.

  • Run the SQL query located in zyke_status/extras/zyke_status.sql.

  • Navigate here and replace the entire function with the code provided below (L274-L281).

-- Modified to execute our export when triggered
-- Also blocks duplicate requests that will occur when we dispatch
function self.Functions.SetMetaData(meta, value)
    if (not meta or type(meta) ~= "string") then return end

    local invoker = GetInvokingResource()

    -- If the request was not made by our resource, dispatch it to us and block the rest
    -- Our system will re-trigger this event after updating all of our values and sync qb-core
    if (invoker ~= "zyke_status") then
        if (meta == "hunger" or meta == "thirst" or meta == "stress") then
            if (value > 100.0) then value = 100.0 end
            if (value < 0.0) then value = 0.0 end

            return exports["zyke_status"]:SetStatusValue(self.PlayerData.source, meta, value)
        end
    end

    self.PlayerData.metadata[meta] = value
    self.Functions.UpdatePlayerData()
end
  • Start zyke_status after zyke_lib, but before all resources that would depend on the status system. By default, this would only be qb-smallresources (or similar) and your hud it has to be above of.

Full Control (Remove QB drains/additions/effects)

  • [Gaining Stress] Navigate here and remove the entire event (L20-L40).

  • [Stress Relieving] Navigate here and remove the entire event (L42-L62).

  • [Hunger & Thirst Drain] Navigate here and replace the entire event with the code provided below (L151-167).

-- Modified to remove hunger & thirst drain
RegisterNetEvent('QBCore:UpdatePlayer', function()
    local ply = QBCore.Functions.GetPlayer(source)
    if (not ply) then return end

    ply.Functions.Save()
end)
  • [Stress Effects] Navigate here and remove the entire thread (L977-L1011)

Last updated

Was this helpful?