# onClientTrailerAttach (Cliente)

> Se dispara en el cliente cuando un remolque se engancha a un vehículo.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Evento Lua
- **Lado**: Cliente
- **Categoría**: Vehículos
- **URL**: https://wiki.mymp.gg/es/onClientTrailerAttach

## Sintaxis

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

## Parámetros del handler

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `towedBy` | `vehicle` | El vehículo que pasó a arrastrar el remolque. |

## Source

El remolque.

## Ejemplo

```lua
addEventHandler("onClientTrailerAttach", root, function(towedBy)
    if getPedOccupiedVehicle(localPlayer) == towedBy then
        outputDebugString("Remolque enganchado")
    end
end)
```

## Ver también

- [onClientTrailerDetach (Cliente)](https://wiki.mymp.gg/es/onClientTrailerDetach.md): Se dispara en el cliente cuando un remolque se suelta del vehículo que lo arrastraba.
- [onTrailerAttach (Servidor)](https://wiki.mymp.gg/es/onTrailerAttach.md): Se dispara en el servidor cuando un remolque se engancha a un vehículo. Cancelar el evento suelta el remolque.
- [getVehicleTowedByVehicle (Compartido)](https://wiki.mymp.gg/es/getVehicleTowedByVehicle.md): Devuelve el remolque o vehículo que este vehículo está remolcando.
- [getVehicleTowingVehicle (Compartido)](https://wiki.mymp.gg/es/getVehicleTowingVehicle.md): Devuelve el vehículo que está remolcando a este vehículo.
