This function does not work for trains.
(vehicleid)
vehicleid
The ID of the vehicle to get the trailer of.
new trailerid = GetVehicleTrailer(vehicleid);
DetachTrailerFromVehicle(trailerid);
The following functions may be useful, as they are related to this function in one way or another.