OrigenNetwork
Docs

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.

text
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 hooks

custom/client/framework.lua

Framework.GetPlayerIdentifier()string | nil

Returns the local player's unique identifier.


custom/client/notify.lua

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.

External interaction system

Used when Config.ExternalInteractionSystem = true. Implement these to use ox_target or similar:

lua
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) end

custom/client/inventory.lua

Custom.OpenStash(id, data) — opens a stash

Called when Config.CustomInventory = true. Implement your stash opening logic here.

lua
Custom.OpenStash = function(id, data)
    -- data: { label, slots, weight }
end

Custom.CanOpenStash(houseID, hasSecurity)boolean

Gate stash access. If the house has the storage_security upgrade, hasSecurity = true. Default returns not hasSecurity.


custom/client/clothing.lua

Custom.Wardrobe(id)

Open the wardrobe for the given ID. Called when Config.CustomClothing = true.

lua
Custom.Wardrobe = function(id)
    -- exports['origen_clothing']:openOutfitMenu(true, true)
end

custom/client/garages.lua

Custom.GiveVehicleKeys(vehicle, plate)

Give vehicle keys after spawning from the garage. Implement your key system here.

lua
Custom.GiveVehicleKeys = function(vehicle, plate)
    TriggerEvent("vehiclekeys:client:SetOwner", plate)
end

Custom.GetVehicleMods(vehicle) / Custom.SetVehicleProperties(vehicle, props)

Get/set vehicle properties. Dispatches to Config.Framework by default.

Custom.GetClosestVehicle(coords)vehicle entity

Find 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/client/house.lua

Custom.CanAccessHouse(houseID)boolean

Gate 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()boolean

Gate opening the in-house management menu.

Custom.OnFreecam(state)

Fired when the freecam (used during house placement/preview) is toggled on/off.


custom/client/robbery.lua

Custom.Dispatch(coords)

Send a robbery alert to police. Default uses origen_police. Override when Config.Dispatch = 'custom'.

lua
Custom.Dispatch = function(coords)
    TriggerServerEvent("SendAlert:police", {
        coords = coords,
        type   = 'GENERAL',
        title  = 'House robbery',
        job    = Config.PoliceJob,
    })
end

Custom.LockpickMinigame(advanced)

Override the lockpick minigame when Config.Lockpick.customLockpickMinigame = true. Call LockpickResult(true/false) with the result.

lua
Custom.LockpickMinigame = function(advanced)
    local result = true  -- your minigame result
    LockpickResult(result)
end

custom/client/raid.lua

Custom.RaidSkillcheck()boolean

Called when police use stormram to raid a house. Default uses lib.skillCheck. Return true on success.


custom/client/weather.lua

Custom.DisableWeatherSync() / Custom.EnableWeatherSync()

Called when entering/exiting a shell interior. Pause/resume your weather sync resource here.


custom/server/framework.lua

FunctionReturnsDescription
Framework.GetIdentifier(source)string | nilPlayer unique identifier
Framework.GetPlayerName(source)string | nilPlayer full name
Framework.GetPlayerJob(source){ name, grade }Player job and grade
Framework.GetMoney(source, method)numberBalance for the given payment method
Framework.RemoveMoney(source, amount, method)Deduct money
Framework.Removeitem(source, itemName, amount)Remove an inventory item
Framework.GetGroup(source)stringPlayer permission group
Framework.GetPoliceCount()numberOfficers currently on duty

custom/server/permissions.lua

Custom.hasPermission(src, action)boolean, string

Check if a player can perform an action ('create', 'delete', 'edit'). Checks job permissions first, then ace permissions, then framework groups.


custom/server/inventory.lua

Custom.RegisterStash(id, data)

Register a stash with the active inventory system. Called when a player enters a house.

lua
Custom.RegisterStash = function(id, data)
    -- data: { label, slots, weight }
    -- exports.ox_inventory:RegisterStash(id, data.label, data.slots, data.weight)
end

custom/server/garages.lua

These functions auto-use Config.Columns to build queries for any framework:

FunctionReturnsDescription
Custom.GetOwnerIdentifierByPlate(plate)string | falseOwner 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

custom/server/house.lua

Event hooks fired at key moments. All are empty by default — add your custom logic:

FunctionFired 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)booleanBefore a purchase — return false to block it