ACE3/addons/common/functions/fnc_syncedEvent.sqf

33 lines
681 B
Plaintext
Raw Normal View History

/*
* Author: jaynus
*
* Call and propegate a synced event
*
* Argument:
* 0: Name (String)
* 1: Arguments (Array)
* 2: TTL (Number or Code) [Optional] for this specific event call
*
* Return value:
* Boolean of success
*/
2015-04-18 02:26:27 +00:00
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
PARAMS_2(_name,_args);
2015-05-14 18:06:06 +00:00
2015-05-14 22:17:41 +00:00
private["_ttl", "_eventData"];
if( (count _this) > 2) then {
_ttl = _this select 2;
} else {
_ttl = 0;
};
if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
diag_log text format["[ACE] Error, synced event key not found."];
false
};
_eventData = [_name, _args,_ttl];
["SEH", _eventData] call FUNC(globalEvent);