Skip to content

Commit

Permalink
docs: update GetVehicleCab.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adib-yg committed Mar 24, 2024
1 parent 8ce9203 commit d051b6d
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions docs/scripting/functions/GetVehicleCab.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
---
title: GetVehicleCab
description: Get the ID of the trailer attached to a vehicle.
description: Get the ID of the cab attached to a vehicle.
tags: ["vehicle"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Get the ID of the trailer attached to a vehicle.
Get the ID of the cab attached to a vehicle.

| Name | Description |
| --------- | -------------------------------------------- |
| vehicleid | The ID of the vehicle to get the trailer of. |
| vehicleid | The ID of the vehicle to get the cab of. |

## Returns

The vehicle ID of the trailer or 0 if no trailer is attached.
The vehicle ID of the cab or **0** if no cab is attached.

## Examples

```c
new
trailerId = GetVehicleCab(vehicleid);
DetachTrailerFromVehicle(trailerId);
new cabId = GetVehicleCab(vehicleid);
```

## Notes
:::warning
This function does not work for trains.
:::
## Related Functions

- [AttachTrailerToVehicle](AttachTrailerToVehicle): Attach a trailer to a vehicle.
- [DetachTrailerFromVehicle](DetachTrailerFromVehicle): Detach a trailer from a vehicle.
- [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): Check if a trailer is attached to a vehicle.
- [GetVehicleTrailer](GetVehicleTrailer): Get the ID of the trailer attached to a vehicle.

0 comments on commit d051b6d

Please sign in to comment.