---
name: "inAreaArrayIndexes"
type: command
status: ok
groups: ["Triggers", "Markers", "Locations", "Positions", "Groups"]
arma3_since: "2.14"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/inAreaArrayIndexes
revid: 370140
updated: 2024-11-01T21:37:46Z
---

# inAreaArrayIndexes

*Command · Triggers, Markers, Locations, Positions, Groups · Arma 3 v2.14*

## Description

Returns indices of positions that are within the provided area.

> [!IMPORTANT]
> Unlike [inAreaArray](../commands/inAreaArray.md), all positions sent to this command are treated as [PositionASL](../topics/Position.md#positionasl) but the center as [PositionAGL](../topics/Position.md).

> [!IMPORTANT]
> Since Arma 3 v2.20 this command is fully compatible with [inAreaArray](../commands/inAreaArray.md), i.e by default all positions given as [Array](../topics/Array.md) or as objects are treated as [PositionAGL](../topics/Position.md). There is also an option to force them to [PositionWorld](../topics/Position.md) format.

## Syntax

### Syntax 1

```sqf
positions inAreaArrayIndexes area
```

**Parameters:**

- `positions`: [Array](../topics/Array.md) of [Object](../topics/Object.md)s and/or [Position](../topics/Position.md)s
- `area`: [Object](../topics/Object.md), [Location](../topics/Location.md) or [String](../topics/String.md) - the defined area:
  - [Object](../topics/Object.md) - trigger
  - [Location](../topics/Location.md) - location
  - [String](../topics/String.md) - marker name

**Returns:** [Array](../topics/Array.md): [Number](../topics/Number.md)s - indexes of matched positions in positions array

### Syntax 2

```sqf
positions inAreaArrayIndexes [centre, a, b, angle, isRectangle, c, usePosWorld]
```

**Parameters:**

- `positions`: [Array](../topics/Array.md) - [Object](../topics/Object.md)s and/or [Position](../topics/Position.md)s to check (see note in description)
- `centre`: [Array](../topics/Array.md) - [Position](../topics/Position.md) [Object](../topics/Object.md) or [Group](../topics/Group.md) (see note in description)
- `a`: [Number](../topics/Number.md) - x axis (x / 2)
- `b`: [Number](../topics/Number.md) - y axis (y / 2)
- `angle`: [Number](../topics/Number.md) - (Optional, default 0) rotation angle
- `isRectangle`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) if rectangle, [false](../commands/false.md) if ellipse
- `c`: [Number](../topics/Number.md) - (Optional, default -1: unlimited) z axis (z / 2)
- `usePosWorld`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) set to [true](../commands/true.md) to treat all positions as [PositionWorld](../topics/Position.md) *(since Arma3 2.20)*

**Returns:** [Array](../topics/Array.md): [Number](../topics/Number.md)s - indexes of matched positions in positions array

### Syntax 3

```sqf
positions inAreaArrayIndexes [pos1, pos2, pos3,...]
```

**Parameters:**

- `positions`: [Array](../topics/Array.md) - [Object](../topics/Object.md)s and/or [Position](../topics/Position.md)s to check.
- `posN`: [Position](../topics/Position.md) - polygon vertices in 2d or 3d format (see [inPolygon](../commands/inPolygon.md))

**Returns:** [Array](../topics/Array.md): [Number](../topics/Number.md)s - indexes of matched positions in positions array

## Examples

### Example 1

```sqf
private _players = call BIS_fnc_listPlayers;
private _indices = _players inAreaArrayIndexes _marker;
{
    private _player = _players select _x;
    ["You are in the marker!"] remoteExec ["hint", _player];
} forEach _indices;
```

## See also

[inAreaArray](../commands/inAreaArray.md) · [inArea](../commands/inArea.md) · [triggerArea](../commands/triggerArea.md)

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