captiveNum: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style='display:none'>Notes</h3> <dl class='command_description'> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> <h3 style='display:none'>Bottom Section</h3>" to "")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma2
|game1= arma2
|version1= 1.00


|1.00
|game2= arma2oa
|version2= 1.50
 
|game3= tkoh
|version3= 1.00
 
|game4= arma3
|version4= 0.50


|arg= global
|arg= global
Line 11: Line 19:
|gr2= Sides
|gr2= Sides


| Checks whether the unit is a [[captive]]. If the unit is a vehicle, its commander is checked instead.<br>
|descr= Checks whether the unit is a [[captive]]. If the unit is a vehicle, its commander is checked instead.<br>
If a unit's captivity level was set as a [[Boolean]], then the returned number is either 0 (for [[false]]) or 1 (for [[true]]).
If a unit's captivity level was set as a [[Boolean]], then the returned number is either 0 (for [[false]]) or 1 (for [[true]]).


| [[captiveNum]] unit
|s1= [[captiveNum]] unit


|p1= unit: [[Object]]
|p1= unit: [[Object]]


| [[Number]] - anything from 0 to value set by [[setCaptive]] alt syntax. A non zero value means [[captive]].
|r1= [[Number]] - anything from 0 to value set by [[setCaptive]] alt syntax. A non zero value means [[captive]].
 
|x1= <code>_captivity = [[captiveNum]] _unit;</code>


|x2= <code>_unit [[setCaptive]] 1024;
|x1= <sqf>_captivity = captiveNum _unit;</sqf>
[[hint]] [[str]] [[captive]] _unit; {{cc|true}}
[[hint]] [[str]] [[captiveNum]] _unit; {{cc|1024}}</code>


|x2= <sqf>
_unit setCaptive 1024;
hint str captive _unit; // true
hint str captiveNum _unit; // 1024
</sqf>


| [[captive]], [[setCaptive]]
|seealso= [[captive]] [[setCaptive]]
}}
}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:42, 3 September 2024

Hover & click on the images for description

Description

Description:
Checks whether the unit is a captive. If the unit is a vehicle, its commander is checked instead.
If a unit's captivity level was set as a Boolean, then the returned number is either 0 (for false) or 1 (for true).
Groups:
Object ManipulationSides

Syntax

Syntax:
captiveNum unit
Parameters:
unit: Object
Return Value:
Number - anything from 0 to value set by setCaptive alt syntax. A non zero value means captive.

Examples

Example 1:
_captivity = captiveNum _unit;
Example 2:
_unit setCaptive 1024; hint str captive _unit; // true hint str captiveNum _unit; // 1024

Additional Information

See also:
captive setCaptive

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note