Only tow company employees#
-- config.lua
Config.requiredJob = 'tow'
Config.crew.requireShift = true
Players without the tow job get a notice at the depot ped. With requireShift, a crew partner is paid only while they are on a shift too.
More than one police job#
Config.PoliceJob = { 'police', 'sheriff', 'sasp' }
Config.rankCustomPrice = 4
Higher impound rates#
Config.impoundTiers = {
tier1 = 0.02,
tier2 = 0.05,
tier3 = 0.10,
}
A $40,000 car held at tier 2 for three days costs 40,000 x 0.05 x 3 = $6,000. Held for five hours, it costs half a day: $1,000.
Logs to a Discord webhook#
Config.Logs.provider = 'webhook'
Config.Logs.webhook = 'https://discord.com/api/webhooks/...'
Any provider other than a running glitch-admin falls back to the webhook. Do not commit the real URL anywhere public.
Mark a plate as important#
-- server, for example when a heist getaway car is spawned
exports['glitch-towing']:addImportantVehicle(plate)
-- later, if the scenario ends another way
exports['glitch-towing']:removeImportantVehicle(plate)
Police cannot clamp an important car. They drive it to the yard and pick Insert Vehicle into Evidence, then the car is removed after Config.timeToImpoundImportant minutes.
Check for an impound before a garage takes a car out#
-- server
if exports['glitch-towing']:IsVehicleImpounded(plate) then
return lib.notify(source, { type = 'error', description = 'That vehicle is impounded.' })
end
IsVehicleImpounded queries the database, so call it from a handler or thread that can wait.
Release from a police MDT#
-- server
local ok, messageKey = exports['glitch-towing']:ReleaseVehicle(source, plate, true)
if not ok then
print(('release refused: %s'):format(messageKey))
end
With asPolice = true the player must be on-duty police at Config.releaseGrade or higher, and no fee is taken. With false the player must own the car, the hold must be over, and the fee comes out of Config.Retrieval.account.
Start or end a shift from a radial menu#
-- client
TriggerEvent('towing:client:towingStart')
TriggerEvent('towing:client:cancelJob')
The server still checks that the player stands within Config.distances.shiftStart of the depot.
Open the impound form for your own flow#
-- client
local result = exports['glitch-towing']:OpenImpoundFormAwait({
plate = 'ABC 123',
model = 'Sultan',
owner = 'John Smith',
vehiclePrice = 40000,
tierRates = { 0.01, 0.02, 0.04 },
canEditFee = false,
lockedFields = { 'plate', 'model', 'owner' },
})
if result then
-- result.tier, result.days, result.hours, result.fee, result.caseId,
-- result.reason, result.approvalMethod, result.approvedBy
end
The form only returns what the officer typed. It does not impound anything, so check the values on your server before you use them.