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.
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, namecustom/server/framework.lua
Framework.GetPlayerIdentifier(source) → string | nil
Returns the unique identifier (citizenid / identifier) for a player server-side.
Framework.GetPlayerIdentifier = function(source)
-- Config.Framework == 'custom': implement here
endFramework.GetPlayerJob(source) → { name, grade }
Returns the job name and grade level of a player.
Framework.GetPlayerJob = function(source)
-- returns { name = 'police', grade = 2 }
endFramework.GetMoney(source) → number
Returns the player's balance for Config.PaymentMethod.
Framework.GetMoney = function(source)
-- Config.PaymentMethod = 'bank' | 'cash'
endFramework.RemoveMoney(source, account, amount) → boolean
Deducts money from the player's account. Returns true on success.
Framework.RemoveMoney = function(source, account, amount)
endFramework.HasPermission(source, group) → boolean
Checks if a player belongs to a permission group. Used by the admin panel against Config.Permissions.
Framework.HasPermission = function(source, group)
endFramework.GetPlayerName(source) → string
Returns the player's full name (firstname + lastname).
Framework.GetPlayerName = function(source)
endcustom/client/framework.lua
Framework.GetPlayerIdentifier() → string | nil
Returns the local player's unique identifier.
Framework.GetPlayerIdentifier = function()
-- Config.Framework == 'custom': implement here
endFramework.GetPlayerJob() → { name, grade }
Returns the local player's current job.
Framework.GetPlayerJob = function()
return { name = 'unknown', grade = 0 }
endFramework.GetPlayerGang() → { name, grade }
Returns the local player's current gang. Default returns unknown.
Framework.GetPlayerGang = function()
return { name = 'unknown', grade = 0 }
endFramework.isPlayerLoaded() → boolean
Returns true when the player's data is ready and loaded.
Framework.isPlayerLoaded = function()
return false -- replace with your check
endcustom/client/keys.lua
Custom.GiveVehicleKeys(vehicle, plate)
Give vehicle keys to the local player after retrieval. Implement your key system here.
Custom.GiveVehicleKeys = function(vehicle, plate)
-- Example with qbx_vehiclekeys:
-- exports['qbx_vehiclekeys']:GiveKeys(vehicle, true)
endcustom/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:
Custom.GetFuel = function(vehicle)
return exports['fuel-system']:GetFuel(vehicle)
end
Custom.SetFuel = function(vehicle, fuelLevel)
exports['fuel-system']:SetFuel(vehicle, fuelLevel)
endcustom/client/notify.lua
Custom.Notify(text, type, length)
Show a notification to the local player.
Custom.Notify = function(text, type, length)
lib.notify({
description = text,
type = type, -- 'info' | 'success' | 'error'
duration = length,
})
endCustom.DrawText(text, key)
Show a text UI interaction hint.
Custom.DrawText = function(text, key)
lib.showTextUI('[' .. key .. '] - ' .. text)
endCustom.HideText()
Hide the text UI hint.
Custom.HideText = function()
lib.hideTextUI()
endcustom/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.
Custom.DisableWeatherSync = function()
-- Example: TriggerEvent('your_weather:pause')
end
Custom.EnableWeatherSync = function()
-- Example: TriggerEvent('your_weather:resume')
end