From Bohemia Interactive Community
Jump to navigation
Jump to search
Notes
- Posted on June 04, 2018 - 19:50 (UTC)
- Lou Montana
-
Here is a countdown, inspired by this function:
_timeout = {
params [
["_time", 30, [0]],
["_colour", "#FFFFFF", [""]]
];
private _timeout = time + _time;
private ["_text", "_remainingTime", "_timeFormat"];
RscFiringDrillTime_done = false;
1 cutRsc ["RscFiringDrillTime", "PLAIN"];
while { time < _timeout } do
{
_remainingTime = _timeout - time;
_timeFormat = [_remainingTime, "MM:SS.MS", true] call BIS_fnc_secondsToString;
_text = format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
_colour,
"A3\Modules_F_Beta\data\FiringDrills\timer_ca",
_timeFormat select 0,
_timeFormat select 1,
_timeFormat select 2];
RscFiringDrillTime_current = parseText _text;
sleep 0.01;
};
_timeFormat = [0, "MM:SS.MS", true] call BIS_fnc_secondsToString;
RscFiringDrillTime_current = parseText format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
_colour,
"A3\Modules_F_Beta\data\FiringDrills\timer_ca",
_timeFormat select 0,
_timeFormat select 1,
_timeFormat select 2];
sleep 4;
RscFiringDrillTime_done = true;
};
↑ Back to spoiler's top
and to use it:
[10, "#FF5500"] call _timeout;
Bottom Section