{"name":"name","title":"name","type":"command","url":"https://community.bistudio.com/wiki/name","revid":373980,"updated":"2025-07-10T15:43:22Z","groups":["Unit Identity","Locations"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","description":"When argument is Object, the command returns the name given to a unit using the setIdentity instruction or selected randomly by the game engine if setIdentity has not been used on the unit.\nIf used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, \"Error: No unit\" is being returned.","syntaxes":[{"syntax":"name object","params":[{"name":"object","type":"Object","type_expr":"Object"}],"returns":{"type":"String","type_expr":"String"},"form":"unary","right":{"text":"object"}},{"syntax":"name location","since":"arma1 1.08","params":[{"name":"location","type":"Location","type_expr":"Location"}],"returns":{"type":"String","type_expr":"String","description":"the location's name. To get its textual value, use text (see Example 3)","text":"String - the location's *name*. To get its textual value, use text (see Example 3)"},"form":"unary","right":{"text":"location"}},{"syntax":"name namespace","since":"arma3 2.18","params":[{"name":"namespace","type":"Namespace","type_expr":"Namespace"}],"returns":{"type":"String","type_expr":"String","description":"namespace's name. Possible values:\n- \"mission\" - for missionNamespace - \"profile\" - for profileNamespace - \"ui\" - for uiNamespace - \"parsing\" - for parsingNamespace - \"local\" - for localNamespace - \"missionprofile\" - for missionProfileNamespace - \"server\" - for serverNamespace - \"\" - for some unnamed namespaces like temporary or server config for example. - \"null\" - null namespace (this should never happen)","text":"String - namespace's *name*. Possible values:\n\n- \"mission\" - for missionNamespace\n- \"profile\" - for profileNamespace\n- \"ui\" - for uiNamespace\n- \"parsing\" - for parsingNamespace\n- \"local\" - for localNamespace\n- \"missionprofile\" - for missionProfileNamespace\n- \"server\" - for serverNamespace\n- \"\" - for some unnamed namespaces like temporary or server config for example.\n- \"null\" - null namespace (this should never happen)"},"form":"unary","right":{"text":"namespace"}},{"syntax":"name scriptHandle","since":"arma3 2.22","params":[{"name":"scriptHandle","type":"Script Handle","type_expr":"Script Handle"}],"returns":{"type":"String","type_expr":"String","description":"The name given to the script via scriptName or the name passed to spawn when creating a \"Empty Handle\""},"form":"unary","right":{"text":"scriptHandle"}}],"examples":[{"code":["_name = name player;"]},{"code":["_locationName = name myLocation;"]},{"code":["name nearestLocation [position player, \"Hill\"]; // \"\"\ntext nearestLocation [position player, \"Hill\"]; // \"Lesnoy Khrebet\""]},{"code":["_currentNamespace = name currentNamespace;"]}],"multiplayer":"name returns profileName, eventually suffixed by the server in the event of identical names, e.g `username`/`username (2)`.","problems":"> [!IMPORTANT]\n> If the provided unit is dead and has been removed from its group, its identity has then been purged to save memory and using name on it will result in a logged error.","see_also":["profileName","setName","setIdentity","nameSound","setNameSound","createLocation","deleteLocation","locationPosition","nearestLocation","nearestLocations","nearestLocationWithDubbing"],"notes":[{"user":"Kju","date":"2017-01-30T19:42:00Z","text":"Location variant appears to be only for the 3d editor."},{"user":"Alef","date":"2009-04-14T01:41:00Z","text":"Will return `Error: No vehicle` for JIP players in init.sqf, if no sleep were performed."}]}