{"name":"createMarker","operator":null,"title":"createMarker","type":"command","url":"https://community.bistudio.com/wiki/createMarker","revid":378854,"updated":"2026-07-21T08:47:29Z","groups":["Markers"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"global","server_exec":false},"exec":null,"description":"Creates a new map marker at the given position. The marker will be created for every connected player as well as all JIP players. The marker name has to be unique; the command will be ignored if a marker with the given name already exists.\n\n> [!IMPORTANT]\n> The marker will be visible only once at least markerType has been defined:\n>\n> ```sqf\n> _marker = createMarker [\"markername\", player]; // Not visible yet.\n> _marker setMarkerType \"hd_dot\"; // Visible.\n> ```\n\n> [!NOTE]\n> If the marker position is given in 3D format, the `z`-coordinate is stored with the marker and will be used when the marker is passed to commands such as createVehicle, createUnit, createAgent, createMine or setVehiclePosition.\n> When a marker is manually placed in the editor, `z` is always 0, which means the marker is placed on the ground. But when the player places a marker on the map in game, it is placed at sea level, so the `z`-coordinate of that marker is `-getTerrainHeightASL markerPos \"userMarker\";`.","syntaxes":[{"syntax":"createMarker [name, position, channel, creator]","since":null,"effect":null,"exec":null,"params":[{"name":"name","type":"String","optional":false,"default":null,"description":"the marker's name, used to reference the marker in scripts.","types":["String"],"since":null,"text":"name: String - the marker's name, used to reference the marker in scripts."},{"name":"position","type":"Position2D, PositionAGL or Object","optional":false,"default":null,"description":"In case of an object, the object's model [0,0,0] is used.","types":["Position2D","PositionAGL","Object"],"since":null,"text":"position: Position2D, PositionAGL or Object - In case of an object, the object's model [0,0,0] is used."},{"name":"channel","type":"Number","optional":true,"default":"-1","description":"the marker channel - see Channel IDs (for multiplayer)","types":["Number"],"since":"arma3 2.02","text":"channel: Number - (Optional, default -1) the marker channel - see Channel IDs (for multiplayer)"},{"name":"creator","type":"Object","optional":true,"default":"objNull","description":"the marker creator (for multiplayer)","types":["Object"],"since":"arma3 2.02","text":"creator: Object - (Optional, default objNull) the marker creator (for multiplayer)"}],"returns":{"type":"String","types":["String"],"description":"the marker's name or empty string if the marker name is not unique.","text":"String - the marker's name or empty string if the marker name is not unique."},"form":"unary","operator":null,"left":null,"right":{"text":"[name, position, channel, creator]","types":["Array"]}}],"examples":[{"text":"```sqf\n_marker1 = createMarker [\"Marker1\", position player];\n```","code":["_marker1 = createMarker [\"Marker1\", position player];"]},{"text":"```sqf\n_marker2 = createMarker [\"Marker2\", player]; // since Arma 3 1.50\n```","code":["_marker2 = createMarker [\"Marker2\", player]; // since Arma 3 1.50"]}],"multiplayer":"> [!NOTE]\n> **Multiplayer optimisation:** Global marker commands always broadcast the *entire* marker state over the network.\n> As such, the number of network messages exchanged when creating or editing a marker can be reduced by performing all but the last operation using local marker commands, then using a global marker command for the last change (and subsequent global broadcast of all changes applied to the marker).","problems":"setMarkerDrawPriority sorts allMapMarkers from least to most priority. Before Arma 3 v2.18 createMarker/createMarkerLocal did **not** care about drawing priority and added the created marker to the end of the array, making it top priority. Running setMarkerDrawPriority again sorted this issue.","aliases":[],"see_also":["createMarkerLocal","deleteMarker","BIS_fnc_markerToString","BIS_fnc_stringToMarker"],"notes":[{"user":"Soldia","date":"2015-09-19T21:02:00Z","text":"createMarker accepts an object as position parameter as well . You could try this with the following code (both SP/MP)\n\n```sqf\n_markerstr = createMarker [\"markername\", player];\n_markerstr setMarkerShape \"RECTANGLE\";\n_markerstr setMarkerSize [100, 100];\n```"},{"user":"X39","date":"2018-05-28T11:57:00Z","text":"In Arma 3, one can create markers which are deletable by the user by prefixing the name with `_USER_DEFINED`.\n\nExample:\n\n```sqf\ncreateMarker \"_USER_DEFINED someMarkerName\"\n```"},{"user":"7erra","date":"2019-05-03T15:53:00Z","text":"There is a new function with which you can create a marker with all settings applied in one step: BIS_fnc_stringToMarker and BIS_fnc_stringToMarkerLocal"},{"user":"Tirpitz","date":"2021-01-26T22:42:00Z","text":"When creating a marker with the name format: \"_USER_DEFINED #n1/n2/n3\".\nn1 can be used to set the owner, n2 I think is an incrementing index to ensure markers are unique, to this end also mangle some more characters onto the end of the string, and n3 is the channel ID the marker is in.\n\n```sqf\n_markerName = format [\"_USER_DEFINED #%1/%2/%3\" , clientOwner,_index, _ChannelID];\n_marker = createMarkerLocal [_markerName, _pos];\n```"},{"user":"POLPOX","date":"2023-07-08T16:03:57Z","text":"If you use the letter \"/\" in the name, it may break the channel visibilities (especially in MP).\nPossible reason is described above by Tirpitz, the engine may confuse which channel the marker belongs to after the \"/\"."},{"user":"Leopard20","date":"2026-07-21T08:47:29Z","text":"You can use a helper function if you intend to call createMarker with duplicate marker names. It doesn't necessarily guarantee that the marker has been created (e.g. it could fail not due to duplicate name, but due to maximum number of allowed markers reached)\n\n```sqf\nprivate _fnc_createMarkerSafe = { private _marker = _this#0; createMarker _this; _marker };\nprivate _marker = [\"MyMarker\", [0,0]] call _fnc_createMarkerSafe; // will return \"MyMarker\"\n```"}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Markers","Introduced with Armed Assault version 1.00","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}