---
name: "openMap"
type: command
status: ok
groups: ["Map", "Interaction"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/openMap
revid: 349654
updated: 2023-11-18T17:02:30Z
---

# openMap

*Command · Map, Interaction · Arma 3 v0.50 · introduced in Arma 2 v1.03*

Locality: effect **local**

## Description

Opens or closes in-game map.

> [!WARNING]
> If `forced` param is set to [true](../commands/true.md) and map is set to open, when the map is opened it cannot be closed manually and the user can get stuck requiring the game restart.
> Make sure you provide scripted mechanics to resolve this, should you need to force the map.
> Useful when you wish to keep user for example on respawn screen, where they could still interact with the map but cannot enter the game until the time is up.

## Syntax

### Syntax 1

```sqf
openMap show
```

**Parameters:**

- `show`: [Boolean](../topics/Boolean.md) - if [true](../commands/true.md) opens map, if [false](../commands/false.md) closes map, provided it is not *forced*

**Returns:** [Boolean](../topics/Boolean.md) - equivalent of [visibleMap](../commands/visibleMap.md)

### Syntax 2

```sqf
openMap [show, forced]
```

**Parameters:**

- `show`: [Boolean](../topics/Boolean.md) - if [true](../commands/true.md) opens map, if [false](../commands/false.md) closes map, provided it is not *forced*.
- `forced`: [Boolean](../topics/Boolean.md) - if [true](../commands/true.md) keeps map from closing when map is open. Arma 3 v2.06 if [false](../commands/false.md), forces map to stay closed if *show* is [false](../commands/false.md) (see [#Example 1](../commands/openMap.md#example-1))

**Returns:** [Boolean](../topics/Boolean.md) - equivalent of [visibleMap](../commands/visibleMap.md)

## Examples

### Example 1

```sqf
openMap [true, false];    // opens map normally
openMap [false, false];    // closes an opened map normally
openMap [true, true];    // force opens map and keeps it open (the user cannot close it on their own)
openMap [false, true];    // since Arma 3 2.06: prevents map from opening, closes open map and forces it to stay close (the user cannot open it on their own)
```

## See also

[forceMap](../commands/forceMap.md) · [forcedMap](../commands/forcedMap.md) · [visibleMap](../commands/visibleMap.md) · [showMap](../commands/showMap.md) · [shownMap](../commands/shownMap.md)

## Community notes

**Fraali** — 2021-12-08

(**As of Arma 3 ver.2.06.148470**)

Trying to close a map using `openMap false` inside of a map event handler like

```sqf
addMissionEventHandler ["Map", { openMap false }];
```

will cause the game to crash.

To fix this, please use it inside of a spawned script.

```sqf
addMissionEventHandler ["Map", { 0 spawn { openMap false }; }];
```

This should stop any issue of crashing when you close the map.

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