ACE3/addons/explosives/functions/fnc_startTimer.sqf

30 lines
758 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Garth 'L-H' de Wet
* Starts a timer for an explosive.
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Time till detonate <NUMBER>
2018-06-22 19:41:43 +00:00
* 2: Trigger classname <STRING> (default: "#timer")
*
* Return Value:
* None
*
* Example:
* [_explosive, 10] call ace_explosives_fnc_startTimer
*
* Public: Yes
*/
2018-06-22 19:41:43 +00:00
params ["_explosive", "_delay", ["_trigger", "#timer", [""]]];
TRACE_3("Starting timer",_explosive,_delay,_trigger);
2015-01-15 20:06:38 +00:00
[{
2018-06-22 19:41:43 +00:00
params ["_explosive", "_trigger"];
TRACE_1("Explosive detonating from timer",_explosive);
2015-01-15 20:06:38 +00:00
if (!isNull _explosive) then {
2018-06-22 19:41:43 +00:00
[_explosive, -1, [_explosive, 0], _trigger] call FUNC(detonateExplosive);
2015-01-15 20:06:38 +00:00
};
2018-06-22 19:41:43 +00:00
}, [_explosive, _trigger], _delay] call CBA_fnc_waitAndExecute;