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.
custom/
├── client.lua ← UI, notifications, minigame, fuel, keys, animations
└── server.lua ← Reward delivery, police detection, vehicle localizercustom/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.
| Parameter | Type | Description |
|---|---|---|
key | string | Key hint to display (framework-dependent) |
msg | string | Message text |
Default implementation uses qb-core:DrawText or ESX.ShowHelpNotification. Replace the body with your own system when Config.CustomNotify = true.
Custom.ShowHelpNotification = function(key, msg)
-- your custom notification here
endCustom.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.
Custom.HideHelpNotification = function()
-- your custom hide logic here
endCustom.ShowNotification(msg)
Displays a standard notification to the player (e.g. reward messages, errors).
| Parameter | Type | Description |
|---|---|---|
msg | string | Message text |
Controlled by Config.CustomNotify in config/_framework.lua:
false(default) → uses native QBCore/ESX notificationtrue→ runs your custom code block
Custom.ShowNotification = function(msg)
-- Put your code here if Config.CustomNotify = true
endCustom.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.
Custom.StartMinigame = function()
return true
-- Example with ox_lib:
-- return exports.ox_lib:skillCheck({'easy', 'easy', 'medium'}, {'w', 'a', 's', 'd'})
endCustom.SetFuel(vehicle, fuel)
Sets the fuel level of the spawned vehicle. Called after a vehicle is delivered.
| Parameter | Type | Description |
|---|---|---|
vehicle | integer | Vehicle entity handle |
fuel | number | Fuel 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'.
Custom.SetFuel = function(vehicle, fuel)
-- Example for a custom resource:
-- exports['my-fuel']:SetFuel(vehicle, fuel)
endCustom.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.
| Parameter | Type | Description |
|---|---|---|
vehicle | integer | Vehicle entity handle |
plate | string | Vehicle plate text |
Default implementation uses vehiclekeys:client:SetOwner (QBCore default). Replace for custom key systems.
Custom.GiveVehicleKeys = function(vehicle, plate)
-- Example for ox_lib keys:
-- exports.ox_inventory:giveItem(cache.playerId, 'keys', 1, { plate = plate })
endCustom.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.
| Parameter | Type | Description |
|---|---|---|
text | string | Alert message (may contain format placeholders for model/color) |
coords | vector3 | Location of the alert |
veh | integer|nil | Vehicle entity handle, or nil if no vehicle |
_Trigger | boolean | If 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.
| Parameter | Type | Description |
|---|---|---|
type | string | Animation key from Config.Animations |
dict | string | Animation dictionary |
anim | string | Animation name |
time | integer|false | Duration in ms, or false to loop indefinitely |
move | boolean | Whether 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')
Custom.GetPolices = function()
-- Replace with your own duty system if needed
return {}
endReward 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.
-- 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)