Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.19

Description

Description:Creates a yes / no message box as a child of the given display. Pressing either button (yes / no) closes the message box, but does nothing else. Use the displaySetEventHandler command to assign what to do, once message box is closed.

Syntax

Syntax:createMessageBox [parent, message]
Parameters:
  • parent: Control - Parent display.
  • message: String - Message text to display above the yes / no buttons.
Return Value:Display

Alternative Syntax

Syntax:createMessageBox [message, scripts, captions, parent] (V3.7+)
Parameters:
  • message: String - Message text to display above the buttons.
  • scripts: Array of Code - Array with one or two elements, which define the code that should be executed, if either the first or the second button is pressed. If only one code element is defined, then only one button is shown.
  • captions: Array of String - Array with one or two elements, which define the captions for the first and second button (optional, default: ["OK","CANCEL"]).
  • parent: Control - Parent display (optional, default: current topmost display).
Return Value:Nothing

Examples

Examples:
_confirm = createMessageBox [_dialog,"This is a message box!"];
_confirm displaySetEventHandler ["Unload", "if (_this select 1 == 1) then {yesbuttonpressed = true}"]

_captions = ["Yeah","Maybe"]; // Button captions
_actions = [
{player setPos [getPos player select 0,getPos player select 1,(getPos player select 2)+500]},
{player setPos [getPos player select 0,getPos player select ),(getPos player select 2)+1]}
]; // Actions for "Yeah" and "Maybe"
createMessageBox ["Would you like to fly?",_actions,_captions];

Additional Information

See also: fn vbs confirmationDialog, warningMessage
Multiplayer: 
Problems: 

Notes