{"name":"joinAs","title":"joinAs","type":"command","url":"https://community.bistudio.com/wiki/joinAs","revid":330016,"updated":"2022-08-15T14:38:07Z","groups":["Groups"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"description":"Joins the unit to the given group, if position id is available, this one is used.","syntaxes":[{"syntax":"unit joinAs [group, id]","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"group","type":"Group","type_expr":"Group"},{"name":"id","type":"Number","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"[group, id]"}}],"examples":[{"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"]}],"see_also":["join","joinAsSilent","joinSilent","group"]}