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