2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-05-30 16:37:03 +00:00
|
|
|
/*
|
|
|
|
* Author: jaynus
|
|
|
|
* Remove a synced event handler
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Name <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* Boolean of success <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* ["bob"] call ace_common_fnc_removeSyncedEventHandler
|
2016-05-30 16:37:03 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_name"];
|
|
|
|
|
2016-07-30 10:28:06 +00:00
|
|
|
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
|
2016-10-02 10:55:31 +00:00
|
|
|
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
|
2016-05-30 16:37:03 +00:00
|
|
|
false
|
|
|
|
};
|
|
|
|
|
2016-07-30 10:28:06 +00:00
|
|
|
private _data = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
|
2016-05-30 16:37:03 +00:00
|
|
|
_data params ["", "", "", "_eventId"];
|
|
|
|
|
2016-06-09 12:24:45 +00:00
|
|
|
[_eventId] call CBA_fnc_removeEventHandler;
|
2016-07-30 10:28:06 +00:00
|
|
|
[GVAR(syncedEvents), _name] call CBA_fnc_hashRem;
|