Skip to content

Retro Police

This section covers configurable handlers, exports, and integration points for developers.


These functions in config.lua let you hook into the scriptโ€™s lifecycle without modifying escrowed code.

config.lua
-- Called when a player is cuffed
Config.OnCuff = function()
-- Close inventory, disable actions, etc.
end
-- Called when a player is uncuffed
Config.OnUnCuff = function()
-- Reopen inventory, re-enable actions, etc.
end
-- Called every tick while cuff is active
Config.OnCuffLoop = function()
-- Custom per-frame logic
end
config.lua
Config.JailInitHandler = function()
-- Called when a player is jailed
end
Config.JailEndHandler = function()
-- Called when a player is released
end
Config.JailJobHandler = function(jobType)
-- Called when a prison job is completed
-- jobType: "shitCleaning", "groundCleaning", "cooking"
end
config.lua
Config.CustomJailMessage = function(jailTime)
TriggerEvent('chat:addMessage', {
color = { 255, 0, 0 },
multiline = true,
args = {
Config.Language.jailAndUtils.jailChatMessage,
(Config.Language.jailAndUtils.jailChatMessageDescription):format(jailTime)
}
})
end
config.lua
Config.VehicleSetup = function(vehicle, plateFormat)
local plate = GetVehicleNumberPlateText(vehicle)
if plateFormat then
plate = string.format(plateFormat,
(lib.string.random('11') .. lib.string.random('AA') .. lib.string.random('11')))
SetVehicleNumberPlateText(vehicle, plate)
end
SetVehicleFuelLevel(vehicle, 100.0)
-- Give keys, set liveries, etc.
-- Return false after DeleteEntity to cancel spawn
end
config.lua
Config.ProgressBar = function(text, time, animDict, animClip, scenario)
-- Uses ox_lib progressBar by default
-- Override to use your own progress bar system
return lib.progressBar({ duration = time, label = text, ... })
end
config.lua
Config.MegaphoneSystemOnChange = function(source, toggle)
if GetPlayerServerId(PlayerId()) == source then
-- Your own player toggled megaphone
else
-- Another player toggled megaphone
end
end
config.lua
-- Used by shooting range and driving parkour for player ID input
Config.IDSystem = function(input)
return tonumber(input)
end
config.lua
-- Return false to deny access to the return locker
Config.ReturnInventoryLockerCheck = function(framework)
return true
end

The script automatically integrates with your clothing system. Supported resources:

ResourceAuto-detected
illenium-appearanceโœ…
fivem-appearanceโœ…
qb-clothingโœ…
esx_skinโœ…

If you use a different clothing system, override Config.ClothingSystemOnChangeOutfit and Config.ClothingSystemReloadSkin in config.lua.

config.lua
Config.ClothingSystemOnChangeOutfit = function(outfitData)
-- outfitData contains: pants, arms, t-shirt, vest, torso2,
-- shoes, accessory, bag, hat, glass, mask, etc.
-- Each has { item = number, texture = number }
end
Config.ClothingSystemReloadSkin = function()
-- Called when player selects "Wear Off Duty"
end

If auto-detection doesnโ€™t work for your setup, use the override options:

config_framework.lua
-- config_framework.lua
return {
Framework = 'AUTO', -- 'ESX', 'QBCore', 'QBX', 'AUTO'
FrameworkNameOverride = nil, -- Force a specific resource name
FrameworkGetterOverride = nil, -- Custom getter function
FrameworkFunctionsOverride = {
client = {},
server = {}
}
}
config_inventory.lua
-- config_inventory.lua
return {
Inventory = 'AUTO', -- 'ox_inventory', 'qb-inventory', 'AUTO', 'CUSTOM'
InventoryNameOverride = nil,
Custom = {
-- Fill these if using Inventory = 'CUSTOM'
getPlayerInventory = function(source) ... end,
clearPlayerInventory = function(source, whitelistItems) ... end,
addItem = function(source, name, count, metadata) ... end,
removeItem = function(source, item, amount, metadata) ... end,
openLockerStash = function(source, lockerConfig, deptId) ... end,
openShop = function(source, shopItems, shopId) ... end,
getLabel = function(itemName) ... end, -- client
openInventory = function(name, type) ... end, -- client
getItemCount = function(item) ... end, -- client
getCurrentWeapon = function() ... end, -- client
},
}