ACE3/addons/common/functions/fnc_removeEventHandler.sqf

25 lines
555 B
Plaintext
Raw Normal View History

/*
* Author: Nou
*
* Remove an event handler.
*
* Argument:
* 0: Event name (string)
* 1: Event code (number)
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
private ["_eventNames", "_eventFunctions", "_eventIndex"];
PARAMS_2(_eventName,_eventCodeIndex);
2015-01-14 20:55:44 +00:00
_eventNames = GVAR(events) select 0;
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
2015-05-14 18:06:06 +00:00
if (_eventIndex != -1) then {
2015-01-14 20:55:44 +00:00
_eventFunctions = (GVAR(events) select 1) select _eventIndex;
_eventFunctions set[_eventCodeIndex, nil];
};