2015-01-13 23:27:42 +00:00
|
|
|
/*
|
|
|
|
* 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"
|
|
|
|
|
2015-05-14 22:12:40 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING("_handleNetEvent");
|
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_3(_eventName,_eventTargets,_eventArgs);
|
2015-01-13 23:27:42 +00:00
|
|
|
|
2015-04-02 23:05:21 +00:00
|
|
|
#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
|
|
|
|
|
2015-01-13 23:27:42 +00:00
|
|
|
ACEc = [_eventName, _eventTargets, _eventArgs];
|
|
|
|
if(!isServer) then {
|
|
|
|
publicVariableServer "ACEc";
|
|
|
|
} else {
|
|
|
|
["ACEc", ACEc] call FUNC(_handleNetEvent);
|
|
|
|
};
|