- Documentation
- Server functions
- getVehicleTowingVehicle
Function
getVehicleTowingVehicle
Returns the vehicle that is towing the given trailer.
Syntax
vehicle getVehicleTowingVehicle(vehicle vehicle)Arguments
vehiclevehicle- The trailer.
Returns
The towing vehicle, or false.
Example
addEventHandler("onTrailerAttach", root, function(towedBy)
local truck = getVehicleTowingVehicle(source)
local driver = truck and getVehicleController(truck)
if driver and getElementType(driver) == "player" then outputChatBox("Naczepa podpieta.", driver) end
end)