ACE3/addons/common/functions/fnc_targetEvent.sqf
2015-08-26 17:39:44 +02:00

34 lines
795 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"
//IGNORE_PRIVATE_WARNING("_handleNetEvent");
PARAMS_3(_eventName,_eventTargets,_eventArgs);
#ifdef DEBUG_EVENTS
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if(!isServer) then {
publicVariableServer "ACEc";
} else {
["ACEc", ACEc] call FUNC(_handleNetEvent);
};