---
name: "effectiveCommander"
type: command
status: ok
groups: ["Unit Control"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/effectiveCommander
revid: 369524
updated: 2024-09-15T17:56:50Z
---

# effectiveCommander

*Command · Unit Control · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to.
So if in a tank there is a gunner and a commander and AI driver, if the [effectiveCommander](../commands/effectiveCommander.md) is gunner, then gunner pressing <kbd>W</kbd> <kbd>A</kbd> <kbd>S</kbd> <kbd>D</kbd> will give AI orders to move.
If gunner jumps out and then enters a tank again, the [effectiveCommander](../commands/effectiveCommander.md) role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis.

## Syntax

```sqf
effectiveCommander vehicle
```

**Parameters:**

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

**Returns:** [Object](../topics/Object.md) - commander unit

## Examples

### Example 1

```sqf
_unit = driver tank;
_effectiveCommander = effectiveCommander _unit;                // returns the tank driver itself
_effectiveCommander = effectiveCommander tank;                // returns the effective commander (commander or gunner or driver)
_effectiveCommander = effectiveCommander vehicle _unit;        // identical to the one above - use [[vehicle]] if only the unit is known
```

## See also

[setEffectiveCommander](../commands/setEffectiveCommander.md) · [commander](../commands/commander.md) · [driver](../commands/driver.md) · [gunner](../commands/gunner.md) · [currentPilot](../commands/currentPilot.md) · [vehicleMoveInfo](../commands/vehicleMoveInfo.md)

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