Advanced FlatbedsAdvanced 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 (attach, ownership, offset editor).
function Alert(msg, nType, timeout)
if Config.ShowAlerts == false then return end
lib.notify({
type = nType,
description = msg,
icon = 'fas fa-truck-ramp-box',
duration = timeout,
position = 'top',
})
end
-- Only if Config.UseTextUI is false (classic GTA help text).
function HelpText(text) end-- Before manage-flatbed, cab controls, and most exports.
-- Default checks vehicle keys, then returns true.
function CanUseFlatbed(truck)
return true
end
-- Before winch or attach. Default skips the truck, BlockedModels, and other flatbeds.
function CanAttachVehicle(vehicle, truck)
return true
end
-- Before putting the player into a loaded vehicle.
function HasOwnership(cargo)
return true
end
-- Blocks warp-in when GTA lock status is 2, 3, or 10.
function IsVehicleLocked(cargo)
return false
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 bed. Engine off, doors locked.
-- qb-vehiclekeys / qs-vehiclekeys lock state is set when those resources are started.
function VehicleAttachedOnFlatbed(vehicle, truck) end
-- After detach. Engine on, unlocked.
function VehicleDetachedFromFlatbed(vehicle, truck) end
-- Panel label for cargo on the bed.
-- 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.
