ACE3/addons/common/functions/fnc_removeEventHandler.sqf

29 lines
559 B
Plaintext
Raw Normal View History

/*
* Author: Nou
* Remove an event handler.
*
* Argument:
2015-09-18 23:50:17 +00:00
* 0: Event name <STRING>
* 1: Event code <NUMBER>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
2015-09-18 23:50:17 +00:00
params ["_eventName", "_eventCodeIndex"];
GVAR(events) params ["_eventNames", "_events"];
private ["_eventFunctions", "_eventIndex"];
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
2015-05-14 18:06:06 +00:00
if (_eventIndex != -1) then {
2015-09-18 23:50:17 +00:00
_eventFunctions = _events select _eventIndex;
_eventFunctions set [_eventCodeIndex, nil];
};