ACE3/addons/common/functions/fnc_targetEvent.sqf

34 lines
758 B
Plaintext
Raw Normal View History

/*
* Author: Nou
* Execute a event only on specific clients.
*
2015-09-19 22:55:58 +00:00
* Arguments:
* 0: Event name (STRING)
* 1: Event targets <OBJECT, ARRAY>
* 2: Event args <ANY>
*
* Note: If local executor is in list of targets, event will execute with
* network delay, and not immediatly.
*
2015-09-19 22:55:58 +00:00
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
2015-09-19 22:55:58 +00:00
params ["_eventName", "_eventTargets", "_eventArgs"];
#ifdef DEBUG_EVENTS
2015-08-26 15:39:44 +00:00
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
2015-09-19 22:55:58 +00:00
if (!isServer) then {
publicVariableServer "ACEc";
} else {
["ACEc", ACEc] call FUNC(_handleNetEvent);
};