getVehicleTowedByVehicle
Shared
Returns the trailer or vehicle this vehicle is towing.
vehicle|false getVehicleTowedByVehicle(vehicle vehicle)
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle that tows. |
Returns
The towed vehicle, or false if it is not towing anything.
Example
addCommandHandler("reboque", function(player)
local vehicle = getPedOccupiedVehicle(player)
local trailer = vehicle and getVehicleTowedByVehicle(vehicle)
if trailer then
fixVehicle(trailer)
end
end)