# onTrailerDetach (Servidor)

> Disparado no servidor quando um reboque é solto do veículo que o puxava.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Evento Lua
- **Lado**: Servidor
- **Categoria**: Veículos
- **URL**: https://wiki.mymp.gg/pt/onTrailerDetach

## Sintaxe

```lua
addEventHandler("onTrailerDetach", root, function(vehicle towedBy) ... end)
```

## Parâmetros do handler

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `towedBy` | `vehicle` | O veículo que puxava o reboque. |

## Source

O reboque.

## Exemplo

```lua
addEventHandler("onTrailerDetach", root, function(towedBy)
    local driver = getVehicleController(towedBy)
    if driver then
        outputDebugString(getPlayerName(driver) .. " soltou o reboque")
    end
end)
```

## Veja também

- [onTrailerAttach (Servidor)](https://wiki.mymp.gg/pt/onTrailerAttach.md): Disparado no servidor quando um reboque é engatado num veículo. Cancelar o evento solta o reboque.
- [onClientTrailerDetach (Cliente)](https://wiki.mymp.gg/pt/onClientTrailerDetach.md): Disparado no cliente quando um reboque é solto do veículo que o puxava.
- [getVehicleTowedByVehicle (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleTowedByVehicle.md): Devolve o reboque ou veículo que este veículo está puxando.
- [getVehicleTowingVehicle (Compartilhado)](https://wiki.mymp.gg/pt/getVehicleTowingVehicle.md): Devolve o veículo que está puxando este veículo.
