Arma 3 Scripting

Function in Missions

BIS_fnc_countdown

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

Description

Triggers a countdown.

Note

The initial countdown can be accessed via missionNamespace's variable BIS_fnc_countdown_time.

The initial value is either serverTime + timeInSeconds (if set globally) or time + timeInSeconds (if set locally). To return the left-over time see #Example 4.

Syntax

[timeInSeconds, global] call BIS_fnc_countdown

Parameters:

Returns: - Number:

Examples

Example 1

private _initialCountdown = [50, false] call BIS_fnc_countdown; // sets countdown to 50 seconds where function is executed

Example 2

private _initialCountdown = [50] call BIS_fnc_countdown; // sets countdown to 50 seconds globally

Example 3

[-1] call BIS_fnc_countdown; // sets BIS_fnc_countdown_time to nil

Example 4

private _timeLeft = [0] call BIS_fnc_countdown; // returns the left over-time

Example 5

private _isTimeLeft = [true] call BIS_fnc_countdown; // returns true if countdown is greater than 0

See also

BIS_fnc_VRTimer