{"name":"allMapMarkers","operator":null,"title":"allMapMarkers","type":"command","url":"https://community.bistudio.com/wiki/allMapMarkers","revid":352645,"updated":"2024-02-17T18:05:11Z","groups":["Markers"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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>LShift</kbd>+<kbd>LMB</kbd>) position, see customWaypointPosition.","syntaxes":[{"syntax":"allMapMarkers","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Array of Strings","types":["Array","String"],"description":null,"text":"Array of Strings"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\n_markers = allMapMarkers; // returns e.g [\"marker1\", \"_USER_DEFINED #2/0\"]\n```","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};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["createMarker","deleteMarker","customWaypointPosition"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Markers","Introduced with Arma 3 version 0.50","Scripting Commands"]}