captive: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. classification)
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(56 intermediate revisions by 8 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 |= Arguments in MP
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Returns if the given unit is captive. "captive" means that enemies will not shoot at the unit. |= Description
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| [[Boolean]] <nowiki>=</nowiki> '''captive''' object|= Syntax
|game5= arma2oa
|version5= 1.50


|p1= object: [[Object]] |= Parameter 1
|game6= tkoh
|version6= 1.00


| [[Boolean]] - 
|game7= arma3
true if the unit is captive, false if not |= Return value
|version7= 0.50
____________________________________________________________________________________________
 
|x1= <pre>?!(captive _general) : _general setCaptive true</pre> |= Example 1
____________________________________________________________________________________________


| [[setCaptive]] |= See also
|arg= global


}}
|gr1= Object Manipulation


<h3 style="display:none">Notes</h3>
|gr2= Sides
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on August 3, 2006 - 14:24</dd>
|descr= Returns the captive state of the given unit (set with [[setCaptive]]). A captive unit will not be attacked by its enemies.
<dt class="note">'''[[User:Hardrock|hardrock]]'''</dt><dd class="note">''Notes from before the conversion:''
{{Feature|important|
While a captive unit won't be attacked, it will still attack its enemies – be sure to [[setBehaviour]] "CARELESS" / [[removeAllWeapons]] accordingly.}}


Use [[setCaptive]] to make a unit captive.
|s1= [[captive]] object
</dd>


<!-- 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.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 VBS2|{{uc:{{PAGENAME}}}}]]

Latest revision as of 10: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