---
name: "BIS_fnc_guiMessage"
type: function
status: ok
groups: ["GUI"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_guiMessage
revid: 329335
updated: 2022-07-27T10:15:21Z
---

# BIS_fnc_guiMessage

*Function · GUI · Arma 3 v0.50*

Locality: effect **local** · executed with **call**

## Description

Displays an interactive message dialog in the center of the screen.

> [!IMPORTANT]
> This function internally utilizes suspension ([waitUntil](../commands/waitUntil.md) to be specific) and therefore has to be executed in a [scheduled environment](../topics/Scheduler.md#scheduled_environment).

## Syntax

```sqf
[message, header, okButton, cancelButton, parent, useParentBox, pause] call BIS_fnc_guiMessage
```

**Parameters:**

- `message`: [String](../topics/String.md) or [Structured Text](../topics/Structured_Text.md) - (Optional, default: "") message
- `header`: [String](../topics/String.md) - (Optional, default: "") header text
- okButton [Boolean](../topics/Boolean.md) or [String](../topics/String.md) - (Optional, default [true](../commands/true.md)):
  - [Boolean](../topics/Boolean.md) - enable the "OK" button
  - [String](../topics/String.md) - custom text for the "OK" button
- `cancelButton`: [Boolean](../topics/Boolean.md) or [String](../topics/String.md) - (Optional, default [false](../commands/false.md)):
  - [Boolean](../topics/Boolean.md) - enable the "Cancel" button
  - [String](../topics/String.md) - custom text for the "Cancel" button
- `parent`: [Display](../topics/Display.md) - (Optional, default: `[] call BIS_fnc_displayMission`) parent display
- `useParentBox`: [Boolean](../topics/Boolean.md) - (Optional, default: [false](../commands/false.md)) try to use control inherited from "RscMessageBox" in parent instead of creating a new one
- `pause`: [Boolean](../topics/Boolean.md) - (Optional, default: [true](../commands/true.md)) pause simulation while message dialog is open (no effect in multiplayer)

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) if the "OK" button was pressed, otherwise [false](../commands/false.md). Returned only after the message box is closed.

## Examples

### Example 1

Because this example uses [spawn](../commands/spawn.md), the return value of [BIS_fnc_guiMessage](../functions/BIS_fnc_guiMessage.md) is lost and can not be used.

```sqf
["Hello World"] spawn BIS_fnc_guiMessage;
```

### Example 2

```sqf
private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage;

if (_result) then {
    systemChat "The player is sure.";
} else {
    systemChat "The player is not sure.";
};
```

## See also

[BIS_fnc_GUIhint](../functions/BIS_fnc_GUIhint.md) · [BIS_fnc_3DENShowMessage](../functions/BIS_fnc_3DENShowMessage.md) · [hintC](../commands/hintC.md)

## Community notes

**AgentRev** — 2014-06-24

Message boxes can be force-closed with:

```sqf
uiNamespace setVariable ["BIS_fnc_guiMessage_status", false];
```

---

**Eden** — 2016-01-13

Calling this function can cause an game crash. When doing this you have to [spawn](../commands/spawn.md) the function or add an spawn around it so you can use the result:

```sqf
[] spawn
{
    private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage;
    // Use _result here
};
```

---

**Demellion** — 2017-11-01

This function only exists along with mission display ([findDisplay](../commands/findDisplay.md) 46). If this function is called before with *-skipIntro* parameter enabled (see Arma 3: Startup Parameters) it will result as [Void](../topics/Void.md).

<sub>Source: [BI Community Wiki — BIS fnc guiMessage](https://community.bistudio.com/wiki/BIS_fnc_guiMessage) (revision 329335).</sub>
