onTrailerDetach | Multi Theft Auto: Wiki Skip to content

onTrailerDetach

Client-side
Server-side
Shared

This event is triggered when a trailer is detached from a truck.

Parameters

vehicle theTruck
  • theTruck: the truck vehicle that this trailer got detached from.

Source

element: The source of this event is the trailer vehicle that the truck got detached from.

Code Examples

server

This example re-attaches a trailer when it detaches.

function reattachTrailer(theTruck)
attachTrailerToVehicle(theTruck, source) -- Reattach the truck and trailer
end
addEventHandler("onTrailerDetach", getRootElement(), reattachTrailer)

See Also

Vehicle Functions