ACE3/addons/explosives/functions/fnc_startTimer.sqf
PabstMirror 08217f460e Explosives - Add code handler for detonation (#5115)
* Explosives - Add code handler for detonation

* Add info to wiki

* Fix cellphone in demo code, move example to wiki
2017-05-10 11:28:44 -05:00

30 lines
784 B
Plaintext

/*
* Author: Garth 'L-H' de Wet
* Starts a timer for an explosive.
*
* Arguments:
* 0: Explosive <OBJECT>
* 1: Time till detonate <NUMBER>
* 2: Trigger Item Classname <STRING><OPTIONAL>
*
* Return Value:
* None
*
* Example:
* [_explosive, 10] call ACE_Explosives_fnc_startTimer;
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_explosive", "_delay", ["_triggerClassname", "#timer", [""]]];
TRACE_3("startTimer",_explosive,_delay,_triggerClassname);
[{
params ["_explosive", "_triggerClassname"];
TRACE_1("Explosive Going Boom",_explosive);
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], _triggerClassname] call FUNC(detonateExplosive);
};
}, [_explosive, _triggerClassname], _delay] call CBA_fnc_waitAndExecute;