Difference between revisions of "captive"

From Bohemia Interactive Community
Jump to navigation Jump to search
 
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
 
(37 intermediate revisions by 15 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#C|COMREF]]
+
{{Command|Comments=
 +
____________________________________________________________________________________________
  
<h2 style="color:#000066"> '''captive ''unit'''''</h2>
+
| ofp |Game name=
  
 +
|1.00|Game version=
  
'''Operand types:'''
+
|arg= global |Multiplayer Arguments=
 +
____________________________________________________________________________________________
  
'''unit:''' [[Object]]
+
| 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=
 +
____________________________________________________________________________________________
  
'''Type of returned value:'''
+
| [[captive]] object |SYNTAX=
  
[[Boolean]]
+
|p1= object: [[Object]] - unit or vehicle |PARAMETER1=
  
'''Description:'''
+
| [[Boolean]] - [[true]] if the unit is captive, [[false]] if not |RETURNVALUE=
 +
____________________________________________________________________________________________
 +
 
 +
|x1= <code>[[if]] ([[captive]] _general) [[then]] { [[removeAllWeapons]] _general; };</code> |EXAMPLE1=
 +
____________________________________________________________________________________________
  
Check if '''unit''' is captive.
+
| [[captiveNum]], [[setCaptive]], [[side]] |SEEALSO=
  
If '''unit''' is a vehicle, its commander is checked.
+
}}
  
 +
<h3 style="display:none">Notes</h3>
 +
<dl class="command_description">
 +
<!-- Note Section BEGIN -->
  
'''Example:'''
+
<!-- Note Section END -->
 +
</dl>
  
? !('''captive''' [[player]]) : [[goto]] "run"
+
<h3 style="display:none">Bottom Section</h3>
 +
 
 +
 
 +
[[Category:Scripting Commands|CAPTIVE]]
 +
[[Category:Scripting Commands OFP 1.99|CAPTIVE]]
 +
[[Category:Scripting Commands OFP 1.96|CAPTIVE]]
 +
[[Category:Scripting Commands OFP 1.46|CAPTIVE]]
 +
[[Category:Scripting Commands Armed Assault|CAPTIVE]]
 +
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 17:50, 3 June 2020

Introduced with Operation Flashpoint version 1.001.00Arguments of this scripting command don't have to be local to the client the command is executed on
Hover & click on the images for descriptions

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.

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

i
Only post proven facts here. Report bugs on the feedback tracker. Use the Talk page or the Forums for discussions.

Notes

Bottom Section