ACE3/addons/common/functions/fnc_waitAndExecute.sqf

24 lines
581 B
Plaintext
Raw Normal View History

2015-01-17 05:58:24 +00:00
/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
* Executes a code once with a given game time delay, using a PFH
2015-01-17 05:58:24 +00:00
*
2015-09-17 16:25:02 +00:00
* Arguments:
* 0: Code to execute <CODE>
* 1: Parameters to run the code with <ARRAY>
* 2: Delay in seconds before executing the code <NUMBER>
2015-01-17 05:58:24 +00:00
*
2015-09-17 16:25:02 +00:00
* Return Value:
* None
*
* Example:
* [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute
*
* Public: Yes
2015-01-17 05:58:24 +00:00
*/
#include "script_component.hpp"
2015-09-17 16:25:02 +00:00
params ["_func", "_params", "_delay"];
2015-01-17 05:58:24 +00:00
2015-09-20 13:52:40 +00:00
GVAR(waitAndExecArray) pushBack [ACE_time + _delay, _func, _params];
GVAR(waitAndExecArray) sort true;