GetVehicleTowingVehicle

From Multi Theft Auto: Wiki
Revision as of 18:13, 17 August 2007 by Norby89 (talk | contribs) (→‎Returns)
Jump to navigation Jump to search

This function is used to get the vehicle that is towing another.

Syntax

vehicle getVehicleTowingVehicle ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle being towed.

Returns

Returns the vehicle that theVehicle is being towed by, false if it isn't being towed.

Example

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

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

See Also