{"name":"setOwner","operator":null,"title":"setOwner","type":"command","url":"https://community.bistudio.com/wiki/setOwner","revid":351991,"updated":"2024-02-01T23:23:57Z","groups":["Multiplayer"],"status":"ok","replaced_by":[],"games":[{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.62"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.62"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":true},"exec":null,"description":"From server machine, change the ownership of an object to a given client. Using command in an unintended way will log a message to .rpt file. To transfer ownership of all AI units in a group properly, use setGroupOwner instead.","syntaxes":[{"syntax":"object setOwner clientID","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":"object to transfer","types":["Object"],"since":null,"text":"object: Object - object to transfer"},{"name":"clientID","type":"Number","optional":false,"default":null,"description":"the machine network ID of the new owner.","types":["Number"],"since":null,"text":"clientID: Number - the machine network ID of the new owner."}],"returns":{"type":"Boolean","types":["Boolean"],"description":"returns true if ownership was successfully transferred, otherwise false","text":"Boolean - returns true if ownership was successfully transferred, otherwise false"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"clientID","types":["Number"]}}],"examples":[{"text":"```sqf\n_someObject setOwner 12;\n```","code":["_someObject setOwner 12;"]},{"text":"```sqf\n_someObject setOwner (owner _playerObject);\n```","code":["_someObject setOwner (owner _playerObject);"]}],"multiplayer":null,"problems":"> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.40, this command should not be used to transfer ownership of units with AI with the exception of agents.\n\n> [!IMPORTANT]\n> **Prior to Arma 3 v1.40** it was not possible to transfer the ownership from a client back to the server.","aliases":[],"see_also":["owner","setGroupOwner","groupOwner","didJIPOwner"],"notes":[],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Command Group: Multiplayer","Introduced with Arma 2: Operation Arrowhead version 1.62","Scripting Commands","Scripting Commands: Server Execution","Take On Helicopters: Scripting Commands"]}