captive: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Comments" to "|Comments=")
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(41 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
|version2= 1.00


|arg= global |Multiplayer Arguments=
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Returns the captive state of the given unit (set with [[setCaptive]]). A captive unit will not be attacked by its enemies.
|game4= arma2
{{Important|
|version4= 1.00
While a captive unit won't be attacked, it will still attack its enemies – be sure to [[setBehaviour]] "CARELESS" / [[removeAllWeapons]] accordingly.}} |DESCRIPTION=
____________________________________________________________________________________________


| [[captive]] object |SYNTAX=
|game5= arma2oa
|version5= 1.50


|p1= object: [[Object]] - unit or vehicle |PARAMETER1=
|game6= tkoh
|version6= 1.00


| [[Boolean]] - [[true]] if the unit is captive, [[false]] if not |RETURNVALUE=
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50
 
|x1= <code>[[if]] ([[captive]] _general) [[then]] { [[removeAllWeapons]] _general; };</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[captiveNum]], [[setCaptive]], [[side]] |SEEALSO=
|arg= global


}}
|gr1= Object Manipulation
 
|gr2= Sides
 
|descr= Returns the captive state of the given unit (set with [[setCaptive]]). A captive unit will not be attacked by its enemies.
{{Feature|important|
While a captive unit won't be attacked, it will still attack its enemies – be sure to [[setBehaviour]] "CARELESS" / [[removeAllWeapons]] accordingly.}}


<h3 style="display:none">Notes</h3>
|s1= [[captive]] object
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|p1= object: [[Object]] - unit or vehicle
</dl>


<h3 style="display:none">Bottom Section</h3>
|r1= [[Boolean]] - [[true]] if the unit is captive, [[false]] if not


|x1= <sqf>if (captive _general) then { removeAllWeapons _general; };</sqf>


[[Category:Scripting Commands|CAPTIVE]]
|seealso= [[captiveNum]] [[setCaptive]] [[side]]
[[Category:Scripting Commands OFP 1.99|CAPTIVE]]
}}
[[Category:Scripting Commands OFP 1.96|CAPTIVE]]
[[Category:Scripting Commands OFP 1.46|CAPTIVE]]
[[Category:Scripting Commands ArmA|CAPTIVE]]
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:21, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns the captive state of the given unit (set with setCaptive). A captive unit will not be attacked by its enemies.
While a captive unit won't be attacked, it will still attack its enemies – be sure to setBehaviour "CARELESS" / removeAllWeapons accordingly.
Groups:
Object ManipulationSides

Syntax

Syntax:
captive object
Parameters:
object: Object - unit or vehicle
Return Value:
Boolean - true if the unit is captive, false if not

Examples

Example 1:
if (captive _general) then { removeAllWeapons _general; };

Additional Information

See also:
captiveNum setCaptive side

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