Arma 3 Scripting

Command in Program Flow

else

Also available as Markdown and JSON, or read the original wiki page.

Description

Executes else code when if condition returns false.

Syntax

thenCode else elseCode

Parameters:

Returns: Array with [thenCode, elseCode]

Examples

Example 1

if (a > b) then { c = 0 } else { c = 1 };

Example 2

if (a < b) then {
    hint "B is greater than A";
} else {
    hint "A is greater than B";
};

See also

Control Structures · if · then