onTrailerDetach
ServerEvent
Fired on the server when a trailer is unhitched from the vehicle towing it.
addEventHandler("onTrailerDetach", root, function(vehicle towedBy) … end)
Handler parameters
| Name | Type | Description |
|---|---|---|
| towedBy | vehicle | The vehicle that was towing the trailer. |
Source
The trailer.
Example
addEventHandler("onTrailerDetach", root, function(towedBy)
local driver = getVehicleController(towedBy)
if driver then
outputDebugString(getPlayerName(driver) .. " soltou o reboque")
end
end)