OrigenNetwork
Docs

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.

text
custom/
├── client.lua  — notifications, fuel, keys, revive, weather
└── server.lua  — notifications, admin check, race join/leave hooks

custom/client.lua

HelpNotify(msg)

Called when the player approaches an arcade access point. Only used when Config.CustomHelpNotify = true.

lua
function HelpNotify(msg)
    -- Default uses qb-core DrawText
    -- Replace with your own:
    -- lib.showTextUI('[E] - ' .. msg)
end

ShowNotify(msg)

Show a notification to the local player. Uses the framework set in Config.Framework.

lua
function ShowNotify(msg)
    -- 'qb'  → QBCore.Functions.Notify(msg, 'success')
    -- 'esx' → ESX.ShowNotification(msg)
    -- custom: implement here
end

SetFuel(vehicle, fuel)

Sets the fuel level of a race vehicle. Called after spawning the player's race vehicle.

lua
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)
end

giveCarKey(plate)

Give the player the keys for their race vehicle. Implement your key system here.

lua
function giveCarKey(plate)
    TriggerEvent("vehiclekeys:client:SetOwner", plate)
    -- Replace with your key system:
    -- exports['qbx_vehiclekeys']:GiveKeys(vehicle, true)
end

leaveRace()

Called when the local player leaves a race. Default behaviour: deletes the race vehicle.

lua
function leaveRace()
    SetEntityInvincible(PlayerPedId(), false)
    local vehicle = GetVehiclePedIsIn(PlayerPedId(), true)
    if vehicle ~= 0 then
        DeleteVehicle(vehicle)
    end
end

revivePlayer()

Called when a player needs to be revived mid-race (e.g. after a crash). Implement your ambulance/revive logic here.

lua
function revivePlayer()
    -- Example:
    -- TriggerEvent('hospital:client:Revive')
end

disableWeather() / enableWeather()

Called when entering and exiting a race to pause/resume your weather sync resource.

lua
function disableWeather()
    -- TriggerEvent('your_weather:pause')
end
 
function enableWeather()
    -- TriggerEvent('your_weather:resume')
end

custom/server.lua

utils.Notify(src, msg)

Send a notification to a player server-side.

lua
utils.Notify = function(src, msg)
    -- 'qb'  → TriggerClientEvent("QBCore:Notify", src, msg)
    -- 'esx' → TriggerClientEvent("esx:showNotification", src, msg)
    -- custom: implement here
end

IsPlayerAdmin(source)boolean

Checks whether a player has admin access based on Config.GroupPermissions. Validates via framework groups and FiveM Ace Permissions.

lua
function IsPlayerAdmin(source)
    -- Default: validates Config.GroupPermissions
    -- via IsPlayerAceAllowed and framework group checks
    return false
end

joinRace(src)

Hook called when a player successfully joins a race session. Implement custom logic here (e.g. logging, stat tracking).

lua
function joinRace(src)
    -- src = server ID of the player who joined
end

leaveRace(src)

Hook called when a player leaves a race session.

lua
function leaveRace(src)
    -- src = server ID of the player who left
end