Jump to content
  • 0

How to prevent map marker spam


Dumgard

Question

I'm having this issue.  Are there any options other than disabling map markers altogether?

 

I'd like to either make it so that it makes a record in the log of who is adding the map markers, or add something like a 5 minute cooldown between map marker adding.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Complete mechanism of this function is very difficult to describe, especially with my level of English.
In short - we take an array of all the markers on the map, and each marker again scroll the array of markers and
delete all that have the same description, except for the current token. 
Written just been me, and has not been tested.
 
// Markers Cleanup
private ["_pre","_cur","_cnt"];
if ((count allMapMarkers) < 10) then 
{
   {
      _pre = toArray _x;
      _cur = _forEachIndex;
      {
         _sx = toArray _x;
         if ((_pre select 0) = (_sx select 0) and (_cur != _forEachIndex)) then {
            deleteMarker _x;
            _cnt++;
         };
      } forEach allMapMarkers;
   } forEach allMapMarkers;
   hint format ["Markers Deleted: %1, thx LMapper", _cnt];
};

The first time I use _forEachIndex, and the Internet do not have any information about her.

 

Used:

   AllMapMarkers

   deleteMarker

   createMarker

   toArray

   forEach

   count

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...