Home › Documentation › Custom · origen_housing
The custom/ folder lets you integrate any framework, inventory, clothing, key system, garage, dispatch and weather sync without touching the core. All files are escrow_ignore — they survive updates.
custom/
├── client/
│ ├── framework.lua — player identifier
│ ├── notify.lua — notifications, draw text, external interactions
│ ├── inventory.lua — stash opening and access gate
│ ├── clothing.lua — wardrobe
│ ├── garages.lua — keys, vehicle mods, custom garage
│ ├── house.lua — access gate, enter/exit hooks
│ ├── robbery.lua — dispatch alert, lockpick minigame
│ ├── raid.lua — raid skill check
│ └── weather.lua — weather sync pause/resume
└── server/
├── framework.lua — identifier, name, job, money, items, police count
├── permissions.lua — permission check
├── inventory.lua — stash registration
├── garages.lua — vehicle queries
└── house.lua — purchase, delete, upgrade, furniture hooksFramework.GetPlayerIdentifier() → string | nilReturns the local player's unique identifier.
Custom.Notify(text, type, length)Show a notification. Default: lib.notify. Override when Config.CustomNotify = true.
Custom.DrawText(text, key) / Custom.HideText()Show/hide interaction hint text. Override when Config.CustomDrawText = true.
Used when Config.ExternalInteractionSystem = true. Implement these to use ox_target or similar:
Custom.CreateCoordsInteraction = function(id, coords, drawDistance, distance, inVehicle, label, onSelect)
-- e.g. exports.ox_target:addCoords(...)
end
Custom.RemoveCoordsInteraction = function(id, coords) end
Custom.CreateEntityInteraction = function(id, type, entity, drawDistance, distance, label, onSelect) end
Custom.RemoveEntityInteraction = function(id, entity) endCustom.OpenStash(id, data) — opens a stashCalled when Config.CustomInventory = true. Implement your stash opening logic here.
Custom.OpenStash = function(id, data)
-- data: { label, slots, weight }
endCustom.CanOpenStash(houseID, hasSecurity) → booleanGate stash access. If the house has the storage_security upgrade, hasSecurity = true. Default returns not hasSecurity.
Custom.Wardrobe(id)Open the wardrobe for the given ID. Called when Config.CustomClothing = true.
Custom.Wardrobe = function(id)
-- exports['origen_clothing']:openOutfitMenu(true, true)
endCustom.GiveVehicleKeys(vehicle, plate)Give vehicle keys after spawning from the garage. Implement your key system here.
Custom.GiveVehicleKeys = function(vehicle, plate)
TriggerEvent("vehiclekeys:client:SetOwner", plate)
endCustom.GetVehicleMods(vehicle) / Custom.SetVehicleProperties(vehicle, props)Get/set vehicle properties. Dispatches to Config.Framework by default.
Custom.GetClosestVehicle(coords) → vehicle entityFind the closest vehicle to given coordinates.
Custom.OpenCustomGarage(houseID, garageType, coords)Open a custom garage system. Called when Config.CustomGarage = true.
Custom.OnEnterGarage(houseID) / Custom.OnExitGarage(houseID)Hooks fired when the player enters or exits the built-in garage interior.
Custom.CanAccessHouse(houseID) → booleanGate entry to a house. Return false to block access.
Custom.OnEnterHouse(houseID) / Custom.OnExitHouse(houseID)Fired when the player enters or exits a house.
Custom.OnNearbyEntryPoint(houseID, distance, isOwned, data)Fired every tick when the player is near an entry point.
Custom.CanOpenHouseMenu() → booleanGate opening the in-house management menu.
Custom.OnFreecam(state)Fired when the freecam (used during house placement/preview) is toggled on/off.
Custom.Dispatch(coords)Send a robbery alert to police. Default uses origen_police. Override when Config.Dispatch = 'custom'.
Custom.Dispatch = function(coords)
TriggerServerEvent("SendAlert:police", {
coords = coords,
type = 'GENERAL',
title = 'House robbery',
job = Config.PoliceJob,
})
endCustom.LockpickMinigame(advanced)Override the lockpick minigame when Config.Lockpick.customLockpickMinigame = true. Call LockpickResult(true/false) with the result.
Custom.LockpickMinigame = function(advanced)
local result = true -- your minigame result
LockpickResult(result)
endCustom.RaidSkillcheck() → booleanCalled when police use stormram to raid a house. Default uses lib.skillCheck. Return true on success.
Custom.DisableWeatherSync() / Custom.EnableWeatherSync()Called when entering/exiting a shell interior. Pause/resume your weather sync resource here.
| Function | Returns | Description |
|---|---|---|
Framework.GetIdentifier(source) | string | nil | Player unique identifier |
Framework.GetPlayerName(source) | string | nil | Player full name |
Framework.GetPlayerJob(source) | { name, grade } | Player job and grade |
Framework.GetMoney(source, method) | number | Balance for the given payment method |
Framework.RemoveMoney(source, amount, method) | — | Deduct money |
Framework.Removeitem(source, itemName, amount) | — | Remove an inventory item |
Framework.GetGroup(source) | string | Player permission group |
Framework.GetPoliceCount() | number | Officers currently on duty |
Custom.hasPermission(src, action) → boolean, stringCheck if a player can perform an action ('create', 'delete', 'edit'). Checks job permissions first, then ace permissions, then framework groups.
Custom.RegisterStash(id, data)Register a stash with the active inventory system. Called when a player enters a house.
Custom.RegisterStash = function(id, data)
-- data: { label, slots, weight }
-- exports.ox_inventory:RegisterStash(id, data.label, data.slots, data.weight)
endThese functions auto-use Config.Columns to build queries for any framework:
| Function | Returns | Description |
|---|---|---|
Custom.GetOwnerIdentifierByPlate(plate) | string | false | Owner identifier for a plate |
Custom.UpdateGarageVehicle(plate, keep, garage, mods, cb) | — | Store or retrieve a vehicle |
Custom.GetVehiclesFromGarage(garage_id) | table[] | All vehicles stored in a garage |
Event hooks fired at key moments. All are empty by default — add your custom logic:
| Function | Fired when |
|---|---|
Custom.OnBuyHouse(src, data) | A player buys a house |
Custom.OnDeleteHouse(src, data) | A house is deleted |
Custom.OnBuyUpgrade(src, data) | A player buys a house upgrade |
Custom.OnBuyFurniture(src, data) | A player buys a furniture item |
Custom.OnDeleteFurniture(src, data) | A furniture item is deleted |
Custom.OnStartBuilding(data) | A house starts its construction stage |
Custom.OnTryBuyObject(src, data) → boolean | Before a purchase — return false to block it |