Custom · origen_races
The custom/ folder lets you integrate your framework, fuel system, key system and game events without touching the core. Both files are escrow_ignore — they survive updates.
custom/
├── client.lua — notifications, fuel, keys, revive, weather
└── server.lua — notifications, admin check, race join/leave hookscustom/client.lua
HelpNotify(msg)
Called when the player approaches an arcade access point. Only used when Config.CustomHelpNotify = true.
function HelpNotify(msg)
-- Default uses qb-core DrawText
-- Replace with your own:
-- lib.showTextUI('[E] - ' .. msg)
endShowNotify(msg)
Show a notification to the local player. Uses the framework set in Config.Framework.
function ShowNotify(msg)
-- 'qb' → QBCore.Functions.Notify(msg, 'success')
-- 'esx' → ESX.ShowNotification(msg)
-- custom: implement here
endSetFuel(vehicle, fuel)
Sets the fuel level of a race vehicle. Called after spawning the player's race vehicle.
function SetFuel(vehicle, fuel)
if Config.Fuel == 'LegacyFuel' then
exports['LegacyFuel']:SetFuel(vehicle, fuel)
end
-- Add your fuel system here:
-- exports['ox_fuel']:SetFuel(vehicle, fuel)
endgiveCarKey(plate)
Give the player the keys for their race vehicle. Implement your key system here.
function giveCarKey(plate)
TriggerEvent("vehiclekeys:client:SetOwner", plate)
-- Replace with your key system:
-- exports['qbx_vehiclekeys']:GiveKeys(vehicle, true)
endleaveRace()
Called when the local player leaves a race. Default behaviour: deletes the race vehicle.
function leaveRace()
SetEntityInvincible(PlayerPedId(), false)
local vehicle = GetVehiclePedIsIn(PlayerPedId(), true)
if vehicle ~= 0 then
DeleteVehicle(vehicle)
end
endrevivePlayer()
Called when a player needs to be revived mid-race (e.g. after a crash). Implement your ambulance/revive logic here.
function revivePlayer()
-- Example:
-- TriggerEvent('hospital:client:Revive')
enddisableWeather() / enableWeather()
Called when entering and exiting a race to pause/resume your weather sync resource.
function disableWeather()
-- TriggerEvent('your_weather:pause')
end
function enableWeather()
-- TriggerEvent('your_weather:resume')
endcustom/server.lua
utils.Notify(src, msg)
Send a notification to a player server-side.
utils.Notify = function(src, msg)
-- 'qb' → TriggerClientEvent("QBCore:Notify", src, msg)
-- 'esx' → TriggerClientEvent("esx:showNotification", src, msg)
-- custom: implement here
endIsPlayerAdmin(source) → boolean
Checks whether a player has admin access based on Config.GroupPermissions. Validates via framework groups and FiveM Ace Permissions.
function IsPlayerAdmin(source)
-- Default: validates Config.GroupPermissions
-- via IsPlayerAceAllowed and framework group checks
return false
endjoinRace(src)
Hook called when a player successfully joins a race session. Implement custom logic here (e.g. logging, stat tracking).
function joinRace(src)
-- src = server ID of the player who joined
endleaveRace(src)
Hook called when a player leaves a race session.
function leaveRace(src)
-- src = server ID of the player who left
end