mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
24 lines
609 B
Plaintext
24 lines
609 B
Plaintext
/*
|
|
* 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;
|
|
|
|
_eventNames = GVAR(events) select 0;
|
|
_eventFunctions = [];
|
|
_eventIndex = _eventNames find _eventName;
|
|
if(_eventIndex != -1) then {
|
|
_eventFunctions = (GVAR(events) select 1) select _eventIndex;
|
|
_eventFunctions set[_eventCodeIndex, nil];
|
|
}; |