{"name":"playersNumber","title":"playersNumber","type":"command","url":"https://community.bistudio.com/wiki/playersNumber","revid":369133,"updated":"2024-09-03T10:34:34Z","groups":["Multiplayer"],"status":"ok","games":{"ofp":"1.80","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.80","arma3_since":"0.50","description":"Returns count of occupied role selection slots for given side. Players who claimed a slot in the lobby but did not start the mission are counted as well. If `disabledAI = 0;` in description.ext or *Enable AI* option is checked in Eden Editor, AI bots will be treated as valid players and will be counted too.","syntaxes":[{"syntax":"playersNumber side","params":[{"name":"side","type":"Side","type_expr":"Side"}],"returns":{"type":"Number","type_expr":"Number"},"form":"unary","right":{"text":"side"}}],"examples":[{"code":["_west = playersNumber west;\n_east = playersNumber east;\n_civ = playersNumber civilian;\nhint format [\"West:%1 East:%2, Civ:%3\", _west, _east, _civ];"]}],"multiplayer":"**Multiplayer only**, in singleplayer it always returns 0.","see_also":["playableSlotsNumber","countSide","allPlayers","allUnits"],"notes":[{"user":"Nelis75733126","date":"2015-04-13T09:44:00Z","text":"**2024-04-16 edit:**\n`playersNumber` returns playable AI as well as human players.\nBy default, a unit (placed down in the editor for example) ONLY becomes playable when the creator specifically checks the relevant checkbox.\n\nIn addition to the examples already given, this is how `playersNumber` can be used to get an array of players and playable AI on the same side as the side of the player:\n\n```sqf\nplayersNumber playerSide;\n```"}]}