Studios
Towinghouse-3.jpg

Commands & Exports

SoonTowingQbox
PAGE 06 OF 06  ·  TROUBLESHOOTING → COMMANDS & EXPORTSdocs.glitchstudios.dev
Browse docs

Commands#

The resource registers no chat commands. Shifts start and end at the depot ped, and police use ox_target options on vehicles. With Config.addRadialOption = true, an End Towing Job item is added to the ox_lib radial menu during a shift.

ox_target options#

Option Where Who
Start Towing Shift / End Towing Shift Depot ped Anyone, or Config.requiredJob
Impounded Vehicles Depot ped Anyone, while retrieval is on. It lists their own held vehicles.
Document Vehicle / Lockpick Vehicle The call's vehicle The tow driver on that call
Impound Any vehicle On-duty police. Opens the Emergency, Criminal Impound and Courtesy Impound menu.
Clamp/Unclamp Any vehicle On-duty police
Lockpick Vehicle Any vehicle On-duty police
Copy Plate Any vehicle On-duty police
Insert Vehicle into Evidence An important vehicle at the yard On-duty police

Server exports#

Export signature Returns
addImportantVehicle(plate) Nothing. Marks the plate as important for Config.importantVehicleMinutes.
removeImportantVehicle(plate) Nothing.
IsVehicleImpounded(plate) true while the plate has an open record (impounded, seized or releasing).
ReleaseVehicle(src, plate, asPolice) ok, messageKey. The key is a locale key such as release_done, release_not_owner, release_not_expired, release_no_money, release_rank or release_db_failed. The export sends no notification.
IsOnTowShift(src) true while the player is on a tow shift.

Client exports#

Export signature Returns
OpenImpoundForm(prefill, cb) false if the form is already open. cb gets the form values, or nil when the officer cancels.
OpenImpoundFormAwait(prefill) The form values, or nil.
IsImpoundFormOpen() true while the form is open.

prefill takes officerName, officerRank, badge, plate, model, colour, owner, location, vehiclePrice, tierRates, canEditFee, lockedFields, and optionally agency, logo and formNumber (they default to Config.Form). The result has tier, days, hours, fee, caseId, reason, approvalMethod (self_approved, approved_verbally or approved_electronically) and approvedBy.

Events other resources can use#

Event Side What it does
towing:client:towingStart Client Starts a shift, with the same server checks as the depot ped.
towing:client:cancelJob Client Ends the shift and removes the truck.

State other resources can read#

State What it means
Entity(vehicle).state.wheelClamped The vehicle has a clamp from this resource.
Entity(vehicle).state.towImpoundPending The vehicle has been impounded and is waiting for, or on, its tow.
GlobalState['glitch-towing:retrieval'] true while the depot retrieval option is on.

Callbacks and net events#

The towing:* lib.callbacks and towing:server:* net events belong to the resource's own client. Each one checks duty, distance, job stage and a throttle on the server. They are not an integration API, so use the exports above.

Database#

Table What it holds
impounded_vehicles One row per criminal impound: model, plate, owner citizenid, fee, expiry, issuing and approving officer, reason, case ID and status (impounded, releasing or released).
player_vehicles (Qbox) Read for ownership. Impounds set state = 2 with body, engine and fuel. Releases and courtesy impounds set state = 1.