Difference between revisions of "captive"

From Bohemia Interactive Community
Jump to navigation Jump to search
 
m (Text replacement - "|= Game name" to "|Game name=")
 
(34 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 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 02:40, 31 August 2019

Introduced with Operation Flashpoint version 1.00
  Arguments of this scripting command don't have to be local to the client the command is executed on

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

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

Multiplayer:
-
See also:
captiveNumsetCaptiveside

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section