captive: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Page update and comment cleanup)
Line 9: Line 9:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Returns if the given unit is captive. "captive" means that enemies will not shoot at the unit. |= Description
| Returns the captive state of the given unit (set with [[setCaptive]]). A captive unit will not be attacked by its enemies.
{{Important|
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
| [[captive]] object |= Syntax


|p1= object: [[Object]] |= Parameter 1
|p1= object: [[Object]] - unit or vehicle |= Parameter 1


| [[Boolean]] - [[true]] if the unit is captive, [[false]] if not |= Return value
| [[Boolean]] - [[true]] if the unit is captive, [[false]] if not |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>[[if]] (![[captive]] _general) [[then]] {_general [[setCaptive]] [[true]]};</code> |= Example 1
|x1= <code>[[if]] ([[captive]] _general) [[then]] { [[removeAllWeapons]] _general; };</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[captiveNum]], [[setCaptive]] |= See also
| [[captiveNum]], [[setCaptive]], [[side]] |= See also


}}
}}
Line 29: Line 31:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on August 3, 2006 - 14:24
<dt class="note">'''[[User:Hardrock|hardrock]]'''<dd class="note">''Notes from before the conversion:''
Use [[setCaptive]] to make a unit captive.


<!-- Note Section END -->
<!-- Note Section END -->

Revision as of 11:36, 25 March 2018

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:
Uncategorised

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:
captiveNumsetCaptiveside

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

Notes

Bottom Section