ACE3/addons/common/functions/fnc_removeSyncedEventHandler.sqf

29 lines
534 B
Plaintext
Raw Normal View History

/*
* Author: jaynus
* Remove a synced event handler
*
2015-09-19 17:26:45 +00:00
* Arguments:
* 0: Name <STRING>
*
2015-09-19 17:26:45 +00:00
* Return Value:
* Boolean of success
2015-09-19 17:26:45 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2015-05-14 22:12:40 +00:00
2015-09-19 17:26:45 +00:00
params ["_name"];
2015-05-14 22:12:40 +00:00
2015-05-14 18:06:06 +00:00
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR("Synced event key not found.");
false
};
2015-09-19 17:26:45 +00:00
private ["_data", "_eventId"];
_data = HASH_GET(GVAR(syncedEvents),_name);
_eventId = _data select 3;
2015-09-19 17:26:45 +00:00
[_eventId] call FUNC(removeEventHandler);
HASH_REM(GVAR(syncedEvents),_name);