{"name":"joinAs","operator":null,"title":"joinAs","type":"command","url":"https://community.bistudio.com/wiki/joinAs","revid":330016,"updated":"2022-08-15T14:38:07Z","groups":["Groups"],"status":"ok","replaced_by":[],"games":[{"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":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Joins the unit to the given group, if position id is available, this one is used.","syntaxes":[{"syntax":"unit joinAs [group, id]","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"group","type":"Group","optional":false,"default":null,"description":null,"types":["Group"],"since":null,"text":"group: Group"},{"name":"id","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"id: Number"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[group, id]","types":["Array"]}}],"examples":[{"text":"```sqf\nplayer joinAs [_group, 4];\n```","code":["player joinAs [_group, 4];"]},{"text":"To get the position id:\n\n```sqf\ngetUnitPositionId = {\n    private [\"_vvn\", \"_str\"];\n    _vvn = vehicleVarName _this;\n    _this setVehicleVarName \"\";\n    _str = str _this;\n    _this setVehicleVarName _vvn;\n    parseNumber (_str select [(_str find \":\") + 1])\n};\nplayer joinAs [createGroup west, 5];\n_id = player call getUnitPositionId;\nhint str _id; // 5\n```","code":["getUnitPositionId = {\n\tprivate [\"_vvn\", \"_str\"];\n\t_vvn = vehicleVarName _this;\n\t_this setVehicleVarName \"\";\n\t_str = str _this;\n\t_this setVehicleVarName _vvn;\n\tparseNumber (_str select [(_str find \":\") + 1])\n};\nplayer joinAs [createGroup west, 5];\n_id = player call getUnitPositionId;\nhint str _id; // 5"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["join","joinAsSilent","joinSilent","group"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Groups","Introduced with Arma 2 version 1.00","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}