ACE3/addons/common/functions/fnc_removeSyncedEventHandler.sqf

27 lines
561 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 {
2016-04-25 20:48:24 +00:00
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["", "", "", "_eventId"];
2015-09-19 17:26:45 +00:00
[_eventId] call FUNC(removeEventHandler);
HASH_REM(GVAR(syncedEvents),_name);