ACE3/addons/common/functions/fnc_targetEvent.sqf
jaynus d81d1b3176 Added: ACE Event stack debugging output, use DEBUG_EVENTS in main\script_debug
Added: PFH Perfcounter tracking+output, use ENABLE_PERFORMANCE_COUNTERS in main\script_debug and then call ace_common_fnc_dumpPerformanceCounters
2015-04-02 16:05:21 -07:00

34 lines
874 B
Plaintext

/*
* Author: Nou
*
* Execute a event only on specific clients.
*
* Argument:
* 0: Event name (string)
* 1: Event targets (object or array of objects)
* 2: Event args (any)
*
* Note: If local executor is in list of targets, event will execute with
* network delay, and not immediatly.
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_eventName", "_eventArgs", "_eventTargets"];
_eventName = _this select 0;
_eventTargets = _this select 1;
_eventArgs = _this select 2;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if(!isServer) then {
publicVariableServer "ACEc";
} else {
["ACEc", ACEc] call FUNC(_handleNetEvent);
};