Adding Frameworks

The rk_chud 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 modules/bridge/ named after your framework (e.g., myframework.lua).

2. Implement Required Functions

Your bridge file must implement these functions:

-- Required: Return player hunger and thirst values
function framework.getPlayerStatus()
    return {
        hunger = hungerValue,  -- 0-100
        thirst = thirstValue   -- 0-100
    }
end

-- Required: Return whether player has loaded
function framework.isPlayerLoaded()
    return playerLoadedState  -- true/false
end

3. Register Player Loaded Event

Listen for your framework's player loaded event and set the player loaded state:

AddEventHandler('myframework:playerLoaded', function()
    playerLoaded = true
end)

4. 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