Advanced TrailersAdvanced Configuration
client/edit.lua
Owner-editable client hooks: notify, keys, attach, vehicle names.
Do not rename these globals. Core client code calls them by name.
Auto-detect examples: Integrations.
When each hook runs
-- Every client notify (hitch, full trailer, offset editor, ownership).
function Alert(msg, nType, timeout)
lib.notify({
type = nType,
description = msg,
icon = "fas fa-truck",
duration = timeout,
position = "top",
})
end
-- Only if Config.UseTextUI is false (classic GTA help text).
function HelpText(text) end-- Before a player vehicle attaches to a trailer (AttachKeybind).
-- Default skips gs-trucking job trailers (state.gs_trucking).
function CanVehicleBeAttachedToTrailer(vehicle, trailer)
return true
end
-- Before third-eye / TextUI manage-trailer.
-- Default skips gs-trucking job trailers, then checks keys.
function CanUseTrailer(trailer)
return true
end
-- Before putting the player into a loaded vehicle from the UI / menu.
function HasOwnership(trailer_car)
return true
endKeys: the first started resource among qbx_vehiclekeys, qb-vehiclekeys, qs-vehiclekeys, wasabi_carlock, mk_vehiclekeys, and MrNewbVehicleKeys. If none are started, both key checks return true.
-- After a vehicle is locked onto the trailer. Engine off, doors locked.
-- qb-vehiclekeys / qs-vehiclekeys lock state is set when those resources are started.
function VehicleAttachedOnTrailer(vehicle) end
-- After detach. Engine on, unlocked.
function VehicleDetachedFromTrailer(vehicle) end
-- UI / menu label for a loaded vehicle.
-- qb-core Shared.Vehicles, then qbx_core GetVehiclesByHash, then GTA label.
function GetVehicleName(vehicle) endAdd your lock script as an elseif IsResourceOnServer(...) next to the existing key branches. Leave the gs-trucking checks in place if you run both resources.
