{"name":"allMapMarkers","title":"allMapMarkers","type":"command","url":"https://community.bistudio.com/wiki/allMapMarkers","revid":352645,"updated":"2024-02-17T18:05:11Z","groups":["Markers"],"status":"ok","games":{"arma3":"0.50"},"since":"arma3 0.50","arma3_since":"0.50","description":"Returns all map marker names, including user-placed markers.\n\n> [!NOTE]\n> - Arma 3 v1.58 User-defined markers have the following name format: `_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID>`, where:\n>   - <PlayerID> - unique network id of the player in String format, also available as String in the 6th param in \"PlayerConnected\" and \"PlayerDisconnected\" Event Handlers\n>   - <MarkerID> - an incrementing marker counter id\n>   - <ChannelID> - id of the chat channel in which the marker was placed (see currentChannel)\n> - To obtain the custom waypoint's (set with <kbd>⇧ Shift</kbd> + Left Mouse Button) position, see customWaypointPosition.","syntaxes":[{"syntax":"allMapMarkers","params":[],"returns":{"type":"Array of Strings","type_expr":"Array<String>"},"form":"nullary"}],"examples":[{"code":["_markers = allMapMarkers; // returns e.g [\"marker1\", \"_USER_DEFINED #2/0\"]"]},{"text":"```sqf\n{\n    private \"_a\";\n    _a = toArray _x;\n    _a resize 15;\n    if (toString _a == \"_USER_DEFINED #\") then\n    // or if (_x select [0, 15] == \"_USER_DEFINED #\") since Arma 3 v1.28\n    {\n        deleteMarker _x;\n    };\n} forEach allMapMarkers;\n```","code":["{\n\tprivate \"_a\";\n\t_a = toArray _x;\n\t_a resize 15;\n\tif (toString _a == \"_USER_DEFINED #\") then\n\t// or if (_x select [0, 15] == \"_USER_DEFINED #\") since Arma 3 v1.28\n\t{\n\t\tdeleteMarker _x;\n\t};\n} forEach allMapMarkers;"]},{"text":"```sqf\nif (_someString in allMapMarkers) then\n{\n    hint (_someString + \" is an existing marker\");\n};\n```","code":["if (_someString in allMapMarkers) then\n{\n\thint (_someString + \" is an existing marker\");\n};"]}],"see_also":["createMarker","deleteMarker","customWaypointPosition"]}