{"name":"BIS_fnc_guiMessage","operator":null,"title":"BIS fnc guiMessage","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_guiMessage","revid":329335,"updated":"2022-07-27T10:15:21Z","groups":["GUI"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":"call","description":"Displays an interactive message dialog in the center of the screen.\n\n> [!IMPORTANT]\n> This function internally utilizes suspension (waitUntil to be specific) and therefore has to be executed in a scheduled environment.","syntaxes":[{"syntax":"[message, header, okButton, cancelButton, parent, useParentBox, pause] call BIS_fnc_guiMessage","since":null,"effect":null,"exec":null,"params":[{"name":"message","type":"String or Structured Text","optional":true,"default":"\"\"","description":"message","types":["String","Structured Text"],"since":null,"text":"message: String or Structured Text - (Optional, default: \"\") message"},{"name":"header","type":"String","optional":true,"default":"\"\"","description":"header text","types":["String"],"since":null,"text":"header: String - (Optional, default: \"\") header text"},{"name":"okButton Boolean or String","type":null,"optional":true,"default":"true","description":":\n- Boolean - enable the \"OK\" button\n- String - custom text for the \"OK\" button","types":["Boolean","String"],"since":null,"text":"okButton Boolean or String - (Optional, default true):\n- Boolean - enable the \"OK\" button\n- String - custom text for the \"OK\" button"},{"name":"cancelButton","type":"Boolean or String","optional":true,"default":"false","description":":\n- Boolean - enable the \"Cancel\" button\n- String - custom text for the \"Cancel\" button","types":["Boolean","String"],"since":null,"text":"cancelButton: Boolean or String - (Optional, default false):\n- Boolean - enable the \"Cancel\" button\n- String - custom text for the \"Cancel\" button"},{"name":"parent","type":"Display","optional":true,"default":"`[] call BIS_fnc_displayMission`","description":"parent display","types":["Display"],"since":null,"text":"parent: Display - (Optional, default: `[] call BIS_fnc_displayMission`) parent display"},{"name":"useParentBox","type":"Boolean","optional":true,"default":"false","description":"try to use control inherited from \"RscMessageBox\" in parent instead of creating a new one","types":["Boolean"],"since":null,"text":"useParentBox: Boolean - (Optional, default: false) try to use control inherited from \"RscMessageBox\" in parent instead of creating a new one"},{"name":"pause","type":"Boolean","optional":true,"default":"true","description":"pause simulation while message dialog is open (no effect in multiplayer)","types":["Boolean"],"since":null,"text":"pause: Boolean - (Optional, default: true) pause simulation while message dialog is open (no effect in multiplayer)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true if the \"OK\" button was pressed, otherwise false. Returned only after the message box is closed.","text":"Boolean - true if the \"OK\" button was pressed, otherwise false. Returned only after the message box is closed."}}],"examples":[{"text":"Because this example uses spawn, the return value of BIS_fnc_guiMessage is lost and can not be used.\n\n```sqf\n[\"Hello World\"] spawn BIS_fnc_guiMessage;\n```","code":["[\"Hello World\"] spawn BIS_fnc_guiMessage;"]},{"text":"```sqf\nprivate _result = [\"Are you sure?\", \"Confirm\", true, true] call BIS_fnc_guiMessage;\n\nif (_result) then {\n    systemChat \"The player is sure.\";\n} else {\n    systemChat \"The player is not sure.\";\n};\n```","code":["private _result = [\"Are you sure?\", \"Confirm\", true, true] call BIS_fnc_guiMessage;\n\nif (_result) then {\n\tsystemChat \"The player is sure.\";\n} else {\n\tsystemChat \"The player is not sure.\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_GUIhint","BIS_fnc_3DENShowMessage","hintC"],"notes":[{"user":"AgentRev","date":"2014-06-24T00:43:00Z","text":"Message boxes can be force-closed with:\n\n```sqf\nuiNamespace setVariable [\"BIS_fnc_guiMessage_status\", false];\n```"},{"user":"Eden","date":"2016-01-13T15:16:00Z","text":"Calling this function can cause an game crash. When doing this you have to spawn the function or add an spawn around it so you can use the result:\n\n```sqf\n[] spawn\n{\n    private _result = [\"Are you sure?\", \"Confirm\", true, true] call BIS_fnc_guiMessage;\n    // Use _result here\n};\n```"},{"user":"Demellion","date":"2017-11-01T18:35:00Z","text":"This function only exists along with mission display (findDisplay 46). If this function is called before with *-skipIntro* parameter enabled (see Arma 3: Startup Parameters) it will result as Void."}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: GUI","Functions","Functions: Local Effect","Introduced with Arma 3 version 0.50","Introduced with Take On Helicopters version 1.00","Take On Helicopters: Functions","Take On Helicopters: New Functions"],"docblock":null,"filled_from_docblock":[]}