{"name":"name","operator":null,"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","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"}],"returns":{"type":"String","types":["String"],"description":null,"text":"String"},"form":"unary","operator":null,"left":null,"right":{"text":"object","types":["Object"]}},{"syntax":"name location","since":"arma1 1.08","effect":null,"exec":null,"params":[{"name":"location","type":"Location","optional":false,"default":null,"description":null,"types":["Location"],"since":null,"text":"location: Location"}],"returns":{"type":"String","types":["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","operator":null,"left":null,"right":{"text":"location","types":["Location"]}},{"syntax":"name namespace","since":"arma3 2.18","effect":null,"exec":null,"params":[{"name":"namespace","type":"Namespace","optional":false,"default":null,"description":null,"types":["Namespace"],"since":null,"text":"namespace: Namespace"}],"returns":{"type":"String","types":["String"],"description":"namespace's name. Possible values: - \"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","operator":null,"left":null,"right":{"text":"namespace","types":["Namespace"]}},{"syntax":"name scriptHandle","since":"arma3 2.22","effect":null,"exec":null,"params":[{"name":"scriptHandle","type":"Script Handle","optional":false,"default":null,"description":null,"types":["Script Handle"],"since":null,"text":"scriptHandle: Script Handle"}],"returns":{"type":"String","types":["String"],"description":"The name given to the script via scriptName or the name passed to spawn when creating a \"Empty Handle\"","text":"String - The name given to the script via scriptName or the name passed to spawn when creating a \"Empty Handle\""},"form":"unary","operator":null,"left":null,"right":{"text":"scriptHandle","types":["Script Handle"]}}],"examples":[{"text":"```sqf\n_name = name player;\n```","code":["_name = name player;"]},{"text":"```sqf\n_locationName = name myLocation;\n```","code":["_locationName = name myLocation;"]},{"text":"```sqf\nname nearestLocation [position player, \"Hill\"]; // \"\"\ntext nearestLocation [position player, \"Hill\"]; // \"Lesnoy Khrebet\"\n```","code":["name nearestLocation [position player, \"Hill\"]; // \"\"\ntext nearestLocation [position player, \"Hill\"]; // \"Lesnoy Khrebet\""]},{"text":"```sqf\n_currentNamespace = name currentNamespace;\n```","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.","aliases":[],"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."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Locations","Command Group: Unit Identity","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}