getVehicleTowedByVehicle | Multi Theft Auto: Wiki Skip to content

getVehicleTowedByVehicle

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to get the vehicle being towed by another.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getTowedByVehicle(...)
  • Variable: .towedByVehicle

Syntax

vehicle getVehicleTowedByVehicle ( vehicle theVehicle )
Required Arguments
  • theVehicle: The vehicle you wish to get the towed vehicle from.

Returns

  • vehicle: value

Returns the vehicle that theVehicle is towing, false if it isn't towing a vehicle.

Code Examples

shared

This example will create a trailer and a trailer-tower, attach them, then check if they attached.

local towingVehicle = createVehicle ( 515, 500, 500, 40 ) -- create a trailer-tower (roadtrain)
local trailer = createVehicle ( 435, 500, 490, 40 ) -- create a trailer
attachTrailerToVehicle ( towingVehicle, trailer ) -- attach them
if ( getVehicleTowedByVehicle ( towingVehicle ) == trailer ) then -- if it attached
outputChatBox ( "The vehicles were attached!" )
end

See Also

Vehicle Functions