ACE3/addons/common/functions/fnc_removeSyncedEventHandler.sqf
Phyma ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00

30 lines
650 B
Plaintext

/*
* Author: jaynus
* Remove a synced event handler
*
* Arguments:
* 0: Name <STRING>
*
* Return Value:
* Boolean of success <BOOL>
*
* Example:
* ["bob"] call ace_common_fnc_removeSyncedEventHandler
*
* Public: No
*/
#include "script_component.hpp"
params ["_name"];
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
_data params ["", "", "", "_eventId"];
[_eventId] call CBA_fnc_removeEventHandler;
[GVAR(syncedEvents), _name] call CBA_fnc_hashRem;