Adding Frameworks

The rk-shud resource supports multiple frameworks out of the box (ESX, OX, QB, QBX), but you can easily add support for your own custom framework by creating a bridge file.

1. Create Your Bridge File

Create a new file in client/framework/ named after your framework (e.g., myframework.lua).

2. Implement Required Functions

Your bridge file must implement these functions:

---@param player number
---@param statusName string
---@return number
function Framework:GetPlayerStatus(player, statusName)
    local playerData = ?
    
    if playerData and playerData.metadata then
        if statusName == 'hunger' then
            return math.floor(playerData.metadata.hunger)
        elseif statusName == 'thirst' then
            return math.floor(playerData.metadata.thirst)
        end
    end
    
    return 0
end

3. Update Configuration

In your config.lua, set the framework name to match your bridge file:

config.framework = 'myframework'  -- Must match your bridge filename

Please note, adding support for custom frameworks will NOT be supported. This is something you must figure out yourself, if you find yourselve struggling to do so, look at the other bridge files within the resource.

Last updated