Installation
The steps to correctly install this on your server.
Step 1 - Install Resource
Step 2 - Edit Target
{
icon = 'truck-ramp-box',
isEnabled = function(data, entityData)
local veh = entityData.entity
local vehEnt = Entity(veh)
if DoesEntityExist(veh) and not IsVehicleAttachedToTrailer(veh) and vehEnt.state.truckingVeh and not vehEnt.state.attachedToTrailer then
local rearWheel = GetEntityBoneIndexByName(veh, 'wheel_lr')
local rearWheelCoords = GetWorldPositionOfEntityBone(veh, rearWheel)
local pos = LocalPlayer.state.position and LocalPlayer.state.position or GetEntityCoords(LocalPlayer.state.ped, false)
if #(rearWheelCoords - pos) <= 3.0 then
return true
end
end
return false
end,
text = 'Trucking - Attach Trailer',
event = 'Trucking:Client:AttachTrailer',
data = {},
minDist = 2.0,
jobs = false
},
{
icon = 'truck-ramp-box',
isEnabled = function(data, entityData)
local veh = entityData.entity
local vehEnt = Entity(veh)
if DoesEntityExist(veh) and IsVehicleAttachedToTrailer(veh) and vehEnt.state.truckingVeh and vehEnt.state.attachedToTrailer and vehEnt.state.inTrailerDeliverZone then
local rearWheel = GetEntityBoneIndexByName(veh, 'wheel_lr')
local rearWheelCoords = GetWorldPositionOfEntityBone(veh, rearWheel)
local pos = LocalPlayer.state.position and LocalPlayer.state.position or GetEntityCoords(LocalPlayer.state.ped, false)
if #(rearWheelCoords - pos) <= 3.0 then
return true
end
end
return false
end,
text = 'Trucking - Deliver Trailer',
event = 'Trucking:Client:DeliverTrailer',
data = {},
minDist = 2.0,
jobs = false
},Step 3 - Edit Config
Step 4 - Ensuring Resource
Last updated