ACE3/addons/common/functions/fnc_localEvent.sqf

37 lines
848 B
Plaintext
Raw Normal View History

/*
* Author: Nou
* Execute a local event on this client only.
*
2015-09-18 16:28:19 +00:00
* Arguments:
* 0: Event name (string)
* 1: Event args (any)
*
2015-09-18 16:28:19 +00:00
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
2015-09-18 16:28:19 +00:00
params ["_eventName", "_eventArgs"];
2016-02-06 20:18:01 +00:00
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
2015-05-14 22:12:40 +00:00
2016-02-06 20:18:01 +00:00
if (!isNil "_eventFunctions") then {
2015-09-18 16:28:19 +00:00
#ifdef DEBUG_EVENTS
2015-08-26 15:39:44 +00:00
ACE_LOGINFO_1("* Local Event: %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
{
2015-09-18 16:28:19 +00:00
if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK
2015-08-26 15:39:44 +00:00
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif
};
2016-02-06 20:18:01 +00:00
} forEach _eventFunctions;
};