Documentation

KAIRO OutfitBag

Hooks & customisation

The core is protected by Cfx escrow, but these files stay open and editable:

  • config.lua and locales/
  • editable/client.lua and editable/server.lua: the hooks below
  • bridge/: framework, inventory, clothing and target integrations
  • install/
Every hook is optional. Returning nil or false keeps the built-in behaviour; return true when you handle it yourself.

Client hooks

FunctionWhen
Custom.Notify(message, kind)Notifications (success, error, inform).
Custom.ShowTextUI(text) / HideTextUI()Custom text UI.
Custom.SaveSkin(ped, part)Save the skin with an unsupported clothing system.
Custom.CanOpen() / CanPlace()Extra checks: handcuffed, dead, in a zone…
Custom.OnMenuOpen() / OnMenuClose()Hide the HUD, disable the phone…
Custom.OnOutfitApplied(name, section)After an outfit (or part of it) is worn.
editable/client.lua
function Custom.Notify(message, kind)
    exports['my-notify']:Send(message, kind)
    return true
end

function Custom.CanOpen()
    if LocalPlayer.state.isCuffed then return false end
    return true
end

function Custom.OnMenuOpen()  TriggerEvent('my-hud:toggle', false) end
function Custom.OnMenuClose() TriggerEvent('my-hud:toggle', true)  end

Server hooks

FunctionWhen
Custom.GetIdentifier(source)Character identifier for custom frameworks or multichar.
Custom.AddItem / RemoveItem(source, item, count)Custom inventories (return true/false, nil = built-in).
Custom.RegisterUsable(item, onUse)Register the usable item yourself.
Custom.Notify(source, message, kind)Notifications from the server.
Custom.CanPlace(source) / CanOpen(source, bagOwner)Permissions: jobs, gangs, VIP, zones… (false = block).
Custom.OnBagPlaced, OnBagPicked, OnOutfitSaved, OnOutfitDeletedLogs and webhooks.
editable/server.lua
function Custom.GetIdentifier(source)
    return exports['my-core']:GetCharId(source)
end

function Custom.RegisterUsable(item, onUse)
    exports['my-inventory']:RegisterUsable(item, function(source) onUse(source) end)
    return true
end

Custom wardrobe

With Config.Wardrobe = 'custom' the bag reads and writes outfits through your functions in editable/server.lua.

editable/server.lua
-- outfit: { id = 'string', name = 'string', model = joaat or nil,
--           components = { [componentId] = { drawable, texture } },
--           props      = { [propId] = { drawable, texture } } }   -- drawable -1 = no prop
Custom.Wardrobe = {
    get = function(identifier)
        return {}               -- list of outfits
    end,
    save = function(identifier, name, outfit, model)
        return true
    end,
    delete = function(identifier, id)
        return true
    end,
}