KAIRO OutfitBag
Hooks & customisation
The core is protected by Cfx escrow, but these files stay open and editable:
config.luaandlocales/editable/client.luaandeditable/server.lua: the hooks belowbridge/: framework, inventory, clothing and target integrationsinstall/
Every hook is optional. Returning
nil or false keeps the built-in behaviour; return true when you handle it yourself.Client hooks
| Function | When |
|---|---|
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) endServer hooks
| Function | When |
|---|---|
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, OnOutfitDeleted | Logs 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
endCustom 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,
}