GetVehicleTowedByVehicle

From Multi Theft Auto: Wiki
Revision as of 15:03, 6 July 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Syntax

vehicle getVehicleTowedByVehicle ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle you wish to get the towed vehicle from.

Returns

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

Example

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

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

See Also