Arma 3 Scripting

Command in Variables, Math

and

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

Description

Returns true only if both conditions are true. In case of the alternative syntax, lazy evaluation is used - if left operand is false, evaluation of the right side is ignored.

Syntax

Syntax 1

a and b

Parameters:

Returns: Boolean

Syntax 2

since arma2oa 1.62

a and b

Parameters:

Returns: Boolean

Examples

Example 1

if ((not isNull player) and (alive player) and (_enemycount == 0)) then
{
    hint "you win !";
};

Example 2

if ((count _array > 0) and { (_array select 0) == player }) then    // works as expected
{
    hint "It works!";
};

if ((count _array > 0) and (_array select 0) == player) then        // Error: _array select 0 is evaluated
{
    hint "It... works?";
};

See also

a && b · or · Operators