Custom · origen_boosting
All files inside the custom/ folder are open source (escrow-ignored) and are the integration layer between origen_boosting and your server's specific resources.
custom/
├── client/
│ ├── framework.lua
│ ├── functions.lua
│ ├── inventory.lua
│ └── notify.lua
└── server/
├── framework.lua
├── functions.lua
├── inventory.lua
└── vinscratch.luacustom/client/framework.lua
Handles how the script reads player data on the client side, depending on the active framework.
Framework._GetPlayerData() → table
Returns the full player data object from the active framework.
Framework._GetPlayerData = function()
if Config.Framework == 'qb-core' or Config.Framework == 'qbx_core' then
return Framework.Functions.GetPlayerData()
elseif Config.Framework == 'esx' then
return Framework.GetPlayerData()
end
endFramework.GetIdentifier() → string
Returns the unique player identifier (citizenid for QBCore/QBX, identifier for ESX).
Framework.GetIdentifier = function()
if Config.Framework == 'qb-core' or Config.Framework == 'qbx_core' then
return Framework.Functions.GetPlayerData().citizenid
elseif Config.Framework == 'esx' then
return Framework.GetPlayerData().identifier
end
endcustom/client/functions.lua
Contains gameplay integration hooks that are called during active missions.
Custom.GiveKeys(plate)
Called when the player successfully steals a vehicle. Implement your key system integration here.
| Parameter | Type | Description |
|---|---|---|
plate | string | License plate of the stolen vehicle |
Custom.GiveKeys = function(plate)
-- Example using qb-vehiclekeys
exports['qb-vehiclekeys']:GiveKeys(plate)
endCustom.Minigame() → boolean
Called when the player must complete the hacking minigame. Must return true on success or false on failure.
By default, uses origen_hacking. Replace with your preferred minigame resource.
Custom.Minigame = function()
local status = exports['origen_hacking']:createGame("alphabet", 30)
return status
endCustom.SendDispatch(data)
Called when a mission event should trigger a police dispatch notification.
| Parameter | Type | Description |
|---|---|---|
data.coords | vector3 | Location of the event |
data.vehicle | number | Entity handle of the vehicle |
Custom.SendDispatch = function(data)
local plate = GetVehicleNumberPlateText(data.vehicle)
exports['ps-dispatch']:CustomAlert({
coords = data.coords,
message = 'Vehicle being stolen - ' .. plate,
dispatchCode = '10-37',
job = { 'police' },
})
endCustom.VehicleDestroy(veh)
Called when the server signals that the mission vehicle should be destroyed. By default, adds a 20-second warning and then triggers an explosion.
| Parameter | Type | Description |
|---|---|---|
veh | number | Entity handle of the vehicle to destroy |
Custom.VehicleDestroy = function(veh)
Internal.Notify(locale('in_game.notifications.vehicle_explosion', 20))
SetTimeout(20000, function()
if DoesEntityExist(veh) then
AddExplosion(GetEntityCoords(veh), 0, 100.0, true, false, true)
end
end)
endCustom.IsOnDuty
Controls whether on-duty state is evaluated before allowing a player to start a mission.
Set to false (default) to disable the check, or assign a function that returns boolean.
-- Default: no duty check
Custom.IsOnDuty = false
-- Example: integrate with origen_police
Custom.IsOnDuty = function()
return exports['origen_police']:IsOnDuty()
endcustom/client/notify.lua
Handles all client-side notifications, UI text prompts, and progress indicators.
Custom.Notify(text, type, length)
Displays a notification to the player. Called when Config.CustomNotify is true or when using a custom framework.
| Parameter | Type | Description |
|---|---|---|
text | string | Notification message |
type | string | Notification type: 'success', 'error', 'info', 'warning' |
length | number | Duration in milliseconds |
Custom.Notify = function(text, type, length)
lib.notify({
description = text,
type = type,
duration = length,
})
endCustom.DrawText(key, text)
Displays a contextual text UI hint on screen.
| Parameter | Type | Description |
|---|---|---|
key | string | Key label shown to the player |
text | string | Description text |
Custom.DrawText = function(key, text)
lib.showTextUI('[' .. key .. '] - ' .. text)
endCustom.HideText()
Hides the text UI hint.
Custom.HideText = function()
lib.hideTextUI()
endCustom.Progress(duration, text) → boolean
Displays a progress circle. Returns true when completed.
| Parameter | Type | Description |
|---|---|---|
duration | number | Duration in milliseconds |
text | string | Label displayed below the progress circle |
Custom.Progress = function(duration, text)
return lib.progressCircle({
canCancel = false,
disable = { car = true },
duration = duration,
label = text,
position = 'bottom',
useWhileDead = false,
})
endcustom/server/framework.lua
Handles all server-side framework operations such as player lookups, money management, and job queries.
Framework.GetIdentifier(source) → string | false
Returns the unique identifier for a player by server id.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
Framework.HasPermission(source, group) → boolean
Checks if a player belongs to a specific admin group.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
group | string | Group name to check against |
Framework.GetPlayerData(source) → table
Returns the raw player object from the active framework.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
Framework.GetMoney(source, account) → number
Returns the balance of a money account for the given player.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
account | string | Account name (e.g. 'bank', 'cash') |
Framework.RemoveMoney(source, account, amount) → boolean
Deducts money from a player's account. Returns true if successful.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
account | string | Account name |
amount | number | Amount to remove |
Framework.AddMoney(source, account, amount) → boolean
Adds money to a player's account.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
account | string | Account name |
amount | number | Amount to add |
Framework.AddOfflineMoney(identifier, account, amount)
Adds money to an offline player's account using their identifier.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Player identifier (citizenid or license) |
account | string | Account name |
amount | number | Amount to add |
Framework.GetPlayerByIdentifier(identifier) → table | nil
Looks up an online player by their unique identifier.
| Parameter | Type | Description |
|---|---|---|
identifier | string | Player identifier (citizenid or license) |
Framework.GetPlayersInJob(jobName) → number
Returns the count of online players currently holding the specified job.
| Parameter | Type | Description |
|---|---|---|
jobName | string | Job name to count |
custom/server/functions.lua
Custom.PlateGenerator
Optional override for the built-in plate generation logic. Set to a function that returns a plate string, or leave as false to use the default generator configured via Config.PlatePattern.
-- Default: use built-in generator
Custom.PlateGenerator = false
-- Custom example
Custom.PlateGenerator = function()
return 'CUSTOM' .. math.random(10, 99)
endcustom/server/inventory.lua
Custom.AddItem(source, name, amount, slot, metadata) → boolean
Called when the script needs to give an item to a player. Implement this when your inventory system is not natively supported or when you need custom logic.
Returns true if the item was successfully added, false otherwise.
| Parameter | Type | Description |
|---|---|---|
source | number | Player server id |
name | string | Item name |
amount | number | Quantity |
slot | number | nil | Target inventory slot (optional) |
metadata | table | nil | Item metadata (optional) |
Custom.AddItem = function(source, name, amount, slot, metadata)
exports['ox_inventory']:AddItem(source, name, amount, metadata)
return true
endcustom/server/vinscratch.lua
Handles the logic for saving a VIN-scratched vehicle to the database when a player completes the VIN scratch interaction.
This callback is registered as origen_boosting:sv:saveVinVehicle and fires when the client requests to save the vehicle after completing the VIN scratch mission step.
Adapt the SQL queries here if your vehicle table structure differs from the default QBCore or ESX schema.
lib.callback.register('origen_boosting:sv:saveVinVehicle', function(source, props, model)
local table = (Config.Framework == 'qb-core' or Config.Framework == 'qbx_core')
and 'player_vehicles'
or 'owned_vehicles'
local identifier = Framework.GetIdentifier(source)
-- QBCore / QBX
if Config.Framework == 'qb-core' or Config.Framework == 'qbx_core' then
MySQL.Async.execute(
'INSERT INTO ' .. table .. ' (license, citizenid, vehicle, hash, mods, plate, vin) VALUES (@license, @citizenid, @vehicle, @hash, @mods, @plate, @vin)',
{
license = GetPlayerIdentifierByType(source, 'license'),
citizenid = identifier,
vehicle = model,
hash = GetHashKey(model),
mods = json.encode(props),
plate = props.plate,
vin = 1,
}
)
end
end)