CBA_fnc_addEventHandlerArgs

Description

Registers an event handler for a specific CBA event with arguments.

A event added with this function will have the following variables defined

_thisArguments passed by function calling the events.  <ANY>
_thisArgsArguments added to event by this function.  <ANY>
_thisIdSame as the return value of this function.  <NUMBER>
_thisTypeName of the event.  (Same as _eventName passed to this function) STRING
_thisFncPiece of code added to the event by this function <CODE>

Parameters

_eventNameType of event to handle.  STRING
_eventFuncFunction to call when event is raised.  <CODE>
_argumentsArguments to pass to event handler.  (optional) <Any>

Returns

_eventIdUnique ID of the event handler (can be used with CBA_fnc_removeEventHandler).

Examples

["test1", {
    systemChat str _thisArgs;
    [_thisType, _thisId] call CBA_fnc_removeEventHandler
}, "hello world"] call CBA_fnc_addEventHandlerArgs;

"test1" call CBA_fnc_localEvent;

Author

commy2

string used by format
Close