OrigenNetwork
Docs

Custom · origen_garages

The custom/ folder lets you integrate any framework, notification system, fuel system or weather sync without touching the core. All files here are escrow_ignore — they survive updates.

text
custom/
├── client/
│   ├── framework.lua  — player identifier, job, gang, loaded state
│   ├── keys.lua       — give vehicle keys on retrieval
│   ├── fuel.lua       — get/set fuel level
│   ├── notify.lua     — notifications and text UI
│   └── weather.lua    — disable/enable weather sync inside interiors
└── server/
    └── framework.lua  — player identifier, job, money, permissions, name

custom/server/framework.lua

Framework.GetPlayerIdentifier(source)string | nil

Returns the unique identifier (citizenid / identifier) for a player server-side.

lua
Framework.GetPlayerIdentifier = function(source)
    -- Config.Framework == 'custom': implement here
end

Framework.GetPlayerJob(source){ name, grade }

Returns the job name and grade level of a player.

lua
Framework.GetPlayerJob = function(source)
    -- returns { name = 'police', grade = 2 }
end

Framework.GetMoney(source)number

Returns the player's balance for Config.PaymentMethod.

lua
Framework.GetMoney = function(source)
    -- Config.PaymentMethod = 'bank' | 'cash'
end

Framework.RemoveMoney(source, account, amount)boolean

Deducts money from the player's account. Returns true on success.

lua
Framework.RemoveMoney = function(source, account, amount)
end

Framework.HasPermission(source, group)boolean

Checks if a player belongs to a permission group. Used by the admin panel against Config.Permissions.

lua
Framework.HasPermission = function(source, group)
end

Framework.GetPlayerName(source)string

Returns the player's full name (firstname + lastname).

lua
Framework.GetPlayerName = function(source)
end

custom/client/framework.lua

Framework.GetPlayerIdentifier()string | nil

Returns the local player's unique identifier.

lua
Framework.GetPlayerIdentifier = function()
    -- Config.Framework == 'custom': implement here
end

Framework.GetPlayerJob(){ name, grade }

Returns the local player's current job.

lua
Framework.GetPlayerJob = function()
    return { name = 'unknown', grade = 0 }
end

Framework.GetPlayerGang(){ name, grade }

Returns the local player's current gang. Default returns unknown.

lua
Framework.GetPlayerGang = function()
    return { name = 'unknown', grade = 0 }
end

Framework.isPlayerLoaded()boolean

Returns true when the player's data is ready and loaded.

lua
Framework.isPlayerLoaded = function()
    return false -- replace with your check
end

custom/client/keys.lua

Custom.GiveVehicleKeys(vehicle, plate)

Give vehicle keys to the local player after retrieval. Implement your key system here.

lua
Custom.GiveVehicleKeys = function(vehicle, plate)
    -- Example with qbx_vehiclekeys:
    -- exports['qbx_vehiclekeys']:GiveKeys(vehicle, true)
end

custom/client/fuel.lua

Custom.GetFuel / Custom.SetFuel

By default both are false (disabled — uses native fuel). Set them to functions to use a custom fuel system:

lua
Custom.GetFuel = function(vehicle)
    return exports['fuel-system']:GetFuel(vehicle)
end
 
Custom.SetFuel = function(vehicle, fuelLevel)
    exports['fuel-system']:SetFuel(vehicle, fuelLevel)
end

custom/client/notify.lua

Custom.Notify(text, type, length)

Show a notification to the local player.

lua
Custom.Notify = function(text, type, length)
    lib.notify({
        description = text,
        type        = type,     -- 'info' | 'success' | 'error'
        duration    = length,
    })
end

Custom.DrawText(text, key)

Show a text UI interaction hint.

lua
Custom.DrawText = function(text, key)
    lib.showTextUI('[' .. key .. '] - ' .. text)
end

Custom.HideText()

Hide the text UI hint.

lua
Custom.HideText = function()
    lib.hideTextUI()
end

custom/client/weather.lua

Custom.DisableWeatherSync() / Custom.EnableWeatherSync()

Called when the player enters or exits a garage interior. Use this to pause/resume your weather sync resource so it doesn't override the interior's static weather.

lua
Custom.DisableWeatherSync = function()
    -- Example: TriggerEvent('your_weather:pause')
end
 
Custom.EnableWeatherSync = function()
    -- Example: TriggerEvent('your_weather:resume')
end