AttachTrailerToVehicle

Description

Attach a vehicle to another vehicle as a trailer.

NameDescription
traileridThe ID of the vehicle that will be pulled.
vehicleidThe ID of the vehicle that will pull the trailer.

Returns

This function always returns 1, even if neither of the vehicle IDs passed are valid.

Examples

new vehicleId = CreateVehicle(...);
new trailerId = CreateVehicle(...);
AttachTrailerToVehicle(trailerId, vehicleId);

Notes

warning

This will only work if both vehicles are streamed in for a player (check IsVehicleStreamedIn).

Related Functions