---
name: "forEachMemberAgent"
type: command
status: ok
groups: ["Program Flow"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/forEachMemberAgent
revid: 330640
updated: 2022-10-03T11:04:22Z
---

# forEachMemberAgent

*Command · Program Flow · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Executes the given command recursively for each agent that is a member of the given team. For just teams use [forEachMemberTeam](../commands/forEachMemberTeam.md). For both teams and agents use [forEachMember](../commands/forEachMember.md).

## Syntax

```sqf
command forEachMemberAgent team
```

**Parameters:**

- `command`: [Code](../topics/Code.md)
- `team`: [Team Member](../topics/Team_Member.md)

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

## See also

[agent](../commands/agent.md) · [agents](../commands/agents.md) · [createAgent](../commands/createAgent.md) · [isAgent](../commands/isAgent.md) · [addTeamMember](../commands/addTeamMember.md) · [createTeam](../commands/createTeam.md) · [deleteTeam](../commands/deleteTeam.md) · [forEachMemberTeam](../commands/forEachMemberTeam.md) · [removeTeamMember](../commands/removeTeamMember.md) · [teamMember](../commands/teamMember.md) · [teamName](../commands/teamName.md) · [teams](../commands/teams.md) · [teamType](../commands/teamType.md) · [forEachMember](../commands/forEachMember.md)

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