---
name: "BIS_fnc_moduleFriendlyFire"
type: function
status: ok
groups: ["Modules"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_moduleFriendlyFire
revid: 379568
updated: 2026-10-31T13:56:44Z
---

# BIS_fnc_moduleFriendlyFire

*Function · Modules · Arma 3 v1.00*

## Description

Handles friendly fire. This is the function of the Friendly Fire module (*ModuleFriendlyFire_F*): when the module is placed in the editor, it is called with the module logic and the units synchronised to the module are checked. It can also be called by scripts with one of the modes below.
"Init" creates the global logic *BIS_FriendlyFire* and checks once per second whether the [player](../commands/player.md) committed friendly fire, which happens when:

- the player becomes a renegade ([side](../commands/side.md) [sideEnemy](../commands/sideEnemy.md)),
- the player (or the player's vehicle or connected UAV) kills one of the checked men,
- the player hits one of the checked vehicles whose priority is above 0, or hits it so that it can no longer move ([canMove](../commands/canMove.md)).

The mission then ends for everyone with the failed ending "FriendlyFire" (see [BIS_fnc_endMission](../functions/BIS_fnc_endMission.md)).
Every mode except "Init" returns [false](../commands/false.md) while the module is not initialised.

## Syntax

### Syntax 1

```sqf
["Init", [units, activated]] call BIS_fnc_moduleFriendlyFire
```

**Parameters:**

- `"Init"`: [String](../topics/String.md) - initialises the module
- `units`: [Array](../topics/Array.md) of [Objects](../topics/Object.md) - (Optional, default `[]`) units and vehicles to check; the crew of a given vehicle is checked as well
- `activated`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) not used

**Returns:** [Boolean](../topics/Boolean.md) - [false](../commands/false.md) if the module was already initialised, otherwise [true](../commands/true.md)

### Syntax 2

```sqf
["Destroy"] call BIS_fnc_moduleFriendlyFire
```

**Parameters:**

- `"Destroy"`: [String](../topics/String.md) - deletes the module logic

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md)

### Syntax 3

```sqf
["AddUnits", [units]] call BIS_fnc_moduleFriendlyFire
```

**Parameters:**

- `"AddUnits"`: [String](../topics/String.md) - adds units to the checked units
- `units`: [Array](../topics/Array.md) of [Objects](../topics/Object.md) - units and vehicles to add (vehicle crews are not added)

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md)

### Syntax 4

```sqf
["RemoveUnits", [units]] call BIS_fnc_moduleFriendlyFire
```

**Parameters:**

- `"RemoveUnits"`: [String](../topics/String.md) - removes units from the checked units
- `units`: [Array](../topics/Array.md) of [Objects](../topics/Object.md) - units to remove

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md)

### Syntax 5

```sqf
["ChangePriority", [vehicle, priority]] call BIS_fnc_moduleFriendlyFire
```

**Parameters:**

- `"ChangePriority"`: [String](../topics/String.md) - changes the priority of a checked vehicle
- `vehicle`: [Object](../topics/Object.md) - checked vehicle
- `priority`: [Number](../topics/Number.md) - (Optional, default 0) if above 0, a single hit by the player counts as friendly fire

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md)

## Examples

### Example 1

```sqf
["Init", [[BIS_vip1, BIS_vip2, BIS_vipCar]]] call BIS_fnc_moduleFriendlyFire;    // BIS_vip1, BIS_vip2, BIS_vipCar and its crew are checked
["AddUnits", [[BIS_vip3]]] call BIS_fnc_moduleFriendlyFire;                        // BIS_vip3 is checked too
["ChangePriority", [BIS_vipCar, 1]] call BIS_fnc_moduleFriendlyFire;            // one hit on BIS_vipCar is friendly fire
["RemoveUnits", [[BIS_vip1]]] call BIS_fnc_moduleFriendlyFire;                    // BIS_vip1 is no longer checked
```

### Example 2

```sqf
["Init", []] call BIS_fnc_moduleFriendlyFire; // only the renegade state is checked
```

## See also

[BIS_fnc_endMission](../functions/BIS_fnc_endMission.md) · [rating](../commands/rating.md) · [addRating](../commands/addRating.md)

<sub>Source: [BI Community Wiki — BIS fnc moduleFriendlyFire](https://community.bistudio.com/wiki/BIS_fnc_moduleFriendlyFire) (revision 379568).</sub>
