AttachTrailerToVehicle

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

This function attaches a trailer-type vehicle to a trailer-towing-type vehicle.

Syntax

bool attachTrailerToVehicle ( vehicle theVehicle, vehicle theTrailer )

Required Arguments

  • theVehicle: The vehicle you wish to attach a trailer to.
  • theTrailer: The trailer you wish to be attached.

Returns

Returns 'true' if the vehicle's were successfully attached, 'false' otherwise.

Example

This example will create a trailer and a trailer-tower, then attach them.

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

See Also