2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* 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")
|
2021-11-07 23:29:27 +00:00
|
|
|
* 3: Unit <OBJECT>
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2017-09-22 15:33:08 +00:00
|
|
|
* [_explosive, 10] call ace_explosives_fnc_startTimer
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-17 05:14:09 +00:00
|
|
|
|
2021-11-07 23:29:27 +00:00
|
|
|
params ["_explosive", "_delay", ["_trigger", "#timer", [""]], ["_unit", objNull, [objNull]]];
|
|
|
|
TRACE_4("Starting timer",_explosive,_delay,_trigger,_unit);
|
2015-01-15 20:06:38 +00:00
|
|
|
|
2015-01-17 06:09:51 +00:00
|
|
|
[{
|
2021-11-07 23:29:27 +00:00
|
|
|
params ["_explosive", "_trigger", "_unit"];
|
2018-06-22 19:41:43 +00:00
|
|
|
TRACE_1("Explosive detonating from timer",_explosive);
|
2015-01-15 20:06:38 +00:00
|
|
|
if (!isNull _explosive) then {
|
2021-11-07 23:29:27 +00:00
|
|
|
[_unit, -1, [_explosive, 0], _trigger] call FUNC(detonateExplosive);
|
2015-01-15 20:06:38 +00:00
|
|
|
};
|
2021-11-07 23:29:27 +00:00
|
|
|
}, [_explosive, _trigger, _unit], _delay] call CBA_fnc_waitAndExecute;
|