Custom · origen_parking
The custom/ folder lets you integrate any framework, key system or fuel system without touching the core. All files here survive updates.
custom/
├── sv_framework.lua — server-side: identifier, permissions, money, notifications, garages
├── sv_keys.lua — server-side: give keys, set lock state
├── cl_framework.lua — client-side: identifier, notifications, player loaded event
├── cl_keys.lua — client-side: read lock state
└── cl_fuel.lua — client-side: get/set fuel levelsv_framework.lua
Framework.GetIdentifier(source) → string | nil
Returns the unique identifier of a player (citizenid / license). Called on every park/retrieve action.
function Framework.GetIdentifier(source)
-- Config.Framework == 'custom'
return nil -- replace with your own logic
endFramework.GetVehicleOwner(plate) → string | nil
Returns the owner identifier for a given plate from the framework's vehicle table.
function Framework.GetVehicleOwner(plate)
-- Config.Framework == 'custom'
return nil
endFramework.SetVehicleStorageState(plate, stored)
Marks a vehicle as stored (stored = true) or out (stored = false) in the framework's vehicle table.
function Framework.SetVehicleStorageState(plate, stored)
-- Config.Framework == 'custom'
endFramework.HasAdminPermission(source, permission) → boolean
Called on all admin callbacks. Permission systems checked in order:
origen_admin—exports['origen_admin']:HasPermission(src, permission)ace—IsPlayerAceAllowed(src, Config.AdminAceNode)qbx/qb— checksPlayerData.groupforgod,superadmin,adminesx— checksxPlayer.getGroup()forsuperadmin,admincustom— implement below
function Framework.HasAdminPermission(source, permission)
-- Config.AdminSystem == 'custom'
return false
endFramework.Notify(source, message, ntype)
Send a notification to a player. ntype: 'info' | 'success' | 'error'
function Framework.Notify(source, message, ntype)
-- Config.NotifySystem == 'custom'
endFramework.GetGarages() → table[]
Returns a list of garages for the admin panel. Each entry: { id, name, label }.
function Framework.GetGarages()
-- Config.GarageIntegration == 'custom'
return {}
endFramework.GetMoney(source) → number
Returns the cash balance of a player. Used by the parking cost system.
function Framework.GetMoney(source)
-- Config.Framework == 'custom'
return 0
endFramework.RemoveMoney(source, amount) → boolean
Deducts cash from a player. Returns true on success.
function Framework.RemoveMoney(source, amount)
-- Config.Framework == 'custom'
return false
endFramework.GetVehicleState(plate) → number | nil
Returns the stored state of a vehicle from the framework's table (1 = out, 0 = stored, or nil if not found).
function Framework.GetVehicleState(plate)
-- Config.Framework == 'custom'
return nil
endsv_keys.lua
Keys.GiveKeys(source, entity, plate)
Give vehicle keys to a player on spawn. Runs when Config.GiveKeysOnSpawn = true.
Supported systems out of the box: qbx_vehiclekeys, qs-vehiclekeys, rk-keys.
function Keys.GiveKeys(source, entity, plate)
-- Config.KeySystem == 'custom'
endKeys.SetLock(entity, locked)
Lock or unlock a vehicle entity server-side. Runs when Config.LockVehiclesOnSpawn = true.
function Keys.SetLock(entity, locked)
-- fallback: SetVehicleDoorsLocked(entity, locked and 2 or 1)
endcl_framework.lua
Framework.GetLocalIdentifier() → string | nil
Returns the local player's unique identifier client-side.
function Framework.GetLocalIdentifier()
-- Config.Framework == 'custom'
return nil
endFramework.NotifyClient(message, notifyType)
Show a notification to the local player. notifyType: 'info' | 'success' | 'error'
function Framework.NotifyClient(message, notifyType)
-- Config.NotifySystem == 'custom'
endFramework.OnPlayerLoaded(callback)
Register a callback that fires when the player's data is ready. Used for initial sync.
function Framework.OnPlayerLoaded(callback)
-- Config.Framework == 'custom'
CreateThread(function() Wait(0); callback() end)
endcl_keys.lua
Keys.IsLocked(vehicle) → boolean
Returns true if the vehicle is currently locked. Reads from state bag first, falls back to native.
function Keys.IsLocked(vehicle)
local stateBagLock = Entity(vehicle).state.doorslockstate
if stateBagLock ~= nil then return stateBagLock >= 2 end
return GetVehicleDoorLockStatus(vehicle) >= 2
endcl_fuel.lua
Fuel.Get(vehicle) → number
Returns the current fuel level (0–100) of a vehicle.
Auto-detection order: ox_fuel → LegacyFuel → ps-fuel → cdn-fuel → native.
function Fuel.Get(vehicle)
-- Config.FuelSystem == 'custom'
return GetVehicleFuelLevel(vehicle)
endFuel.Set(vehicle, level)
Sets the fuel level (0–100) of a vehicle. Always calls SetVehicleFuelLevel as base, then the active system on top.
function Fuel.Set(vehicle, level)
-- Config.FuelSystem == 'custom'
SetVehicleFuelLevel(vehicle, level + 0.0)
end