{"name":"captive","title":"captive","type":"command","url":"https://community.bistudio.com/wiki/captive","revid":318573,"updated":"2022-05-13T09:21:07Z","groups":["Object Manipulation","Sides"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"global"},"description":"Returns the captive state of the given unit (set with setCaptive). A captive unit will not be attacked by its enemies.\n\n> [!IMPORTANT]\n> While a captive unit won't be attacked, it will still attack its enemies – be sure to setBehaviour \"CARELESS\" / removeAllWeapons accordingly.","syntaxes":[{"syntax":"captive object","params":[{"name":"object","type":"Object","description":"unit or vehicle","type_expr":"Object"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true if the unit is captive, false if not"},"form":"unary","right":{"text":"object"}}],"examples":[{"code":["if (captive _general) then { removeAllWeapons _general; };"]}],"see_also":["captiveNum","setCaptive","side"]}