ACE3/addons/common/functions/fnc_removeAllEventHandlers.sqf
2015-05-14 20:06:06 +02:00

21 lines
463 B
Plaintext

/*
* Author: Nou
*
* Remove all events of a certain event type.
*
* Argument:
* 0: Event name (string)
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_eventNames", "_eventFunctions", "_eventIndex"];
PARAMS_1(_eventName);
_eventNames = GVAR(events) select 0;
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
if (_eventIndex != -1) then {
(GVAR(events) select 1) set [_eventIndex, []];
};