---
name: "assignedVehicleRole"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/assignedVehicleRole
revid: 338904
updated: 2023-04-17T14:28:10Z
---

# assignedVehicleRole

*Command · Object Manipulation · Arma 3 v0.50 · introduced in Armed Assault v1.05*

Locality: arguments **global**

## Description

Returns the role a unit is assigned to within its assigned vehicle.

> [!NOTE]
> See AI Group Vehicle Management for more information.

## Syntax

```sqf
assignedVehicleRole unitName
```

**Parameters:**

- `unitName`: [Object](../topics/Object.md)

**Returns:** [Array](../topics/Array.md) - the array which is returned contains:

- [] - not assigned to any vehicle
- ["driver"] - Assigned as driver
- ["cargo"] or Arma 3 v1.32 ["cargo", [turret path]] - assigned as cargo
- ["turret", turretPath] - assigned to a turret (turretPath format Turret Path)

## Examples

### Example 1

```sqf
_RoleArray = assignedVehicleRole player;
```

### Example 2

Get weapons available to player at player occupied turret:

```sqf
_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);
```

## Multiplayer

On a client the command will return empty arrays for every unit that is not local. On the server the command correctly returns the role, regardless of the units locality.

## See also

[addVehicle](../commands/addVehicle.md) · [assignedVehicle](../commands/assignedVehicle.md) · [unassignVehicle](../commands/unassignVehicle.md) · [leaveVehicle](../commands/leaveVehicle.md) · [assignAsCargo](../commands/assignAsCargo.md) · [assignAsCommander](../commands/assignAsCommander.md) · [assignAsDriver](../commands/assignAsDriver.md) · [assignAsGunner](../commands/assignAsGunner.md) · [assignAsTurret](../commands/assignAsTurret.md) · [crew](../commands/crew.md) · [assignedVehicles](../commands/assignedVehicles.md) · [assignedGroup](../commands/assignedGroup.md) · [fullCrew](../commands/fullCrew.md)

## Community notes

**Killzone_Kid** — 2013-08-31

When player is in a group of AIs and is not the leader, [assignedVehicleRole](../commands/assignedVehicleRole.md) of the player could be unpredictable and absolutely not related to the position player occupies.
In short, forget about this command for the player, it is unreliable and has been broken too many times in the past.

<sub>Source: [BI Community Wiki — assignedVehicleRole](https://community.bistudio.com/wiki/assignedVehicleRole) (revision 338904).</sub>
