mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
24 lines
610 B
Plaintext
24 lines
610 B
Plaintext
/*
|
|
* Author: Nou
|
|
* Remove an event handler.
|
|
*
|
|
* Argument:
|
|
* 0: Event name <STRING>
|
|
* 1: Event code <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_eventName", "_eventCodeIndex"];
|
|
|
|
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
|
|
|
if (isNil "_eventFunctions") exitWith {TRACE_1("eventName not found",_eventName);};
|
|
if ((_eventCodeIndex < 0) || {(count _eventFunctions) <= _eventCodeIndex}) exitWith {TRACE_2("index out of bounds",_eventName,_eventCodeIndex);};
|
|
|
|
_eventFunctions set [_eventCodeIndex, nil];
|