Marker Events - CBATeam/CBA_A3 GitHub Wiki
Marker Events are event handlers that are executed when a marker was created or deleted.
Adding and removing Marker Events
Marker Events are added via CBA_fnc_addMarkerEventHandler
. The function returns an ID that can be used to remove the event with CBA_fnc_removeMarkerEventHandler
later.
The events will only be executed if they were added on the local machine, but will execute for markers created or deleted on remote machines.
Examples
["created", {
params ["_newMarker"];
systemChat format ["Marker %1 was created", _newMarker];
}] call CBA_fnc_addMarkerEventHandler;
My_MarkerDeletedId = ["deleted", {
params ["_marker"];
if (_marker == "My_ImportantMarker") then {
systemChat "Marker was deleted";
["deleted", My_MarkerDeletedId] call CBA_fnc_removeMarkerEventHandler;
My_MarkerDeletedId = nil;
};
}] call CBA_fnc_removeMarkerEventHandler;