---
name: "getCargoIndex"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.26"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getCargoIndex
revid: 369168
updated: 2024-09-03T10:34:42Z
---

# getCargoIndex

*Command · Object Manipulation · Arma 3 v1.26*

Locality: arguments **global**

## Description

Returns index of the unit in cargo. -1 if not in cargo.

## Syntax

```sqf
vehicle getCargoIndex unit
```

**Parameters:**

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

**Returns:** [Number](../topics/Number.md)

## Examples

### Example 1

```sqf
player moveInCargo heli;
hint str (heli getCargoIndex player);
```

## See also

[moveInCargo](../commands/moveInCargo.md) · [assignAsCargoIndex](../commands/assignAsCargoIndex.md) · [emptyPositions](../commands/emptyPositions.md)

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