{"name":"captiveNum","operator":null,"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","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":null,"server_exec":false},"exec":null,"description":"Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead.\n\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","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"}],"returns":{"type":"Number","types":["Number"],"description":"anything from 0 to value set by setCaptive alt syntax. A non zero value means captive.","text":"Number - anything from 0 to value set by setCaptive alt syntax. A non zero value means captive."},"form":"unary","operator":null,"left":null,"right":{"text":"unit","types":["Object"]}}],"examples":[{"text":"```sqf\n_captivity = captiveNum _unit;\n```","code":["_captivity = captiveNum _unit;"]},{"text":"```sqf\n_unit setCaptive 1024;\nhint str captive _unit; // true\nhint str captiveNum _unit; // 1024\n```","code":["_unit setCaptive 1024;\nhint str captive _unit; // true\nhint str captiveNum _unit; // 1024"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["captive","setCaptive"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Sides","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}