OrigenNetwork
Docs

Custom · origen_importheist

The custom/ folder contains the extension layer of the script. These files are not escrowed and are designed to be modified to match your server's frameworks, resources, and preferences.

text
custom/
├── client.lua   ← UI, notifications, minigame, fuel, keys, animations
└── server.lua   ← Reward delivery, police detection, vehicle localizer

custom/client.lua

Custom.ShowHelpNotification(key, msg)

Displays a contextual help notification (e.g. "Press E to rob"). Called when the player is inside an interaction zone.

ParameterTypeDescription
keystringKey hint to display (framework-dependent)
msgstringMessage text

Default implementation uses qb-core:DrawText or ESX.ShowHelpNotification. Replace the body with your own system when Config.CustomNotify = true.

lua
Custom.ShowHelpNotification = function(key, msg)
    -- your custom notification here
end

Custom.HideHelpNotification()

Hides the contextual help notification. Called when the player leaves the interaction zone.

Default implementation calls qb-core:HideText for QBCore. Replace if using a different notification resource.

lua
Custom.HideHelpNotification = function()
    -- your custom hide logic here
end

Custom.ShowNotification(msg)

Displays a standard notification to the player (e.g. reward messages, errors).

ParameterTypeDescription
msgstringMessage text

Controlled by Config.CustomNotify in config/_framework.lua:

  • false (default) → uses native QBCore/ESX notification
  • true → runs your custom code block
lua
Custom.ShowNotification = function(msg)
    -- Put your code here if Config.CustomNotify = true
end

Custom.StartMinigame()boolean

Called when the player attempts to loot a vehicle locker. Must return true to allow the action, or false to deny it.

The default implementation always returns true (no minigame). Replace with your own minigame export.

lua
Custom.StartMinigame = function()
    return true
    -- Example with ox_lib:
    -- return exports.ox_lib:skillCheck({'easy', 'easy', 'medium'}, {'w', 'a', 's', 'd'})
end

Custom.SetFuel(vehicle, fuel)

Sets the fuel level of the spawned vehicle. Called after a vehicle is delivered.

ParameterTypeDescription
vehicleintegerVehicle entity handle
fuelnumberFuel level (0–100)

Controlled by Config.FuelSystem in config/_framework.lua. Supported values out of the box: 'none', 'LegacyFuel', 'ps-fuel', 'cdn-fuel', 'qs-fuelstations', 'ox_fuel'.

lua
Custom.SetFuel = function(vehicle, fuel)
    -- Example for a custom resource:
    -- exports['my-fuel']:SetFuel(vehicle, fuel)
end

Custom.GiveVehicleKeys(vehicle, plate)

Gives vehicle ownership to the player after completing the heist. Called server-side via a client event after the vehicle is spawned.

ParameterTypeDescription
vehicleintegerVehicle entity handle
platestringVehicle plate text

Default implementation uses vehiclekeys:client:SetOwner (QBCore default). Replace for custom key systems.

lua
Custom.GiveVehicleKeys = function(vehicle, plate)
    -- Example for ox_lib keys:
    -- exports.ox_inventory:giveItem(cache.playerId, 'keys', 1, { plate = plate })
end

Custom.PoliceCall(text, coords, veh, _Trigger)

Sends a police alert when the player enters a warehouse (if Config.NotifyCopsOnEntry = true). Internally triggers SendAlert:police server event with vehicle metadata.

ParameterTypeDescription
textstringAlert message (may contain format placeholders for model/color)
coordsvector3Location of the alert
vehinteger|nilVehicle entity handle, or nil if no vehicle
_TriggerbooleanIf true, also registers the vehicle in the GPS localizer

This function is pre-wired and does not usually need to be modified. Customize only if your server uses a different alert resource.


Custom.PlayAnim(type, dict, anim, time, move)

Plays a ped animation from the Config.Animations table. Used internally for 'search' and 'checking' actions.

ParameterTypeDescription
typestringAnimation key from Config.Animations
dictstringAnimation dictionary
animstringAnimation name
timeinteger|falseDuration in ms, or false to loop indefinitely
movebooleanWhether the ped can move during the animation

custom/server.lua

Custom.GetPolices()integer[]

Returns a table of server IDs for all on-duty police officers. Used to check Config.MinCops and to send GPS localizer updates.

Default implementation:

  • QBCore: QBCore.Functions.GetPlayersOnDuty('police')
  • ESX + origen_police: exports['origen_police']:GetPlayersInDuty('police')
  • ESX fallback: ESX.GetExtendedPlayers('job', 'police')
lua
Custom.GetPolices = function()
    -- Replace with your own duty system if needed
    return {}
end

Reward delivery (server event)

The origen_importheist:reward server event is handled inside custom/server.lua. It gives money or an item to the player based on Config.Reward.

lua
-- Automatically triggered by the script — not a public API.
-- Modify if you need custom reward logic (e.g. adding XP, logging, etc.)
 
RegisterServerEvent('origen_importheist:reward', function(total)
    local Player = FW_GetPlayer(source)
    if Config.Reward.useItem then
        Player.Functions.AddItem(Config.Reward.item, total)
    else
        Player.Functions.AddMoney(Config.Reward.account, total)
    end
end)