{"name":"captiveNum","title":"captiveNum","type":"command","url":"https://community.bistudio.com/wiki/captiveNum","revid":369311,"updated":"2024-09-03T18:42:55Z","groups":["Object Manipulation","Sides"],"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"},"description":"Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead.\nIf a unit's captivity level was set as a Boolean, then the returned number is either 0 (for false) or 1 (for true).","syntaxes":[{"syntax":"captiveNum unit","params":[{"name":"unit","type":"Object","type_expr":"Object"}],"returns":{"type":"Number","type_expr":"Number","description":"anything from 0 to value set by setCaptive alt syntax. A non zero value means captive."},"form":"unary","right":{"text":"unit"}}],"examples":[{"code":["_captivity = captiveNum _unit;"]},{"code":["_unit setCaptive 1024;\nhint str captive _unit; // true\nhint str captiveNum _unit; // 1024"]}],"see_also":["captive","setCaptive"]}