Difference between revisions of "alive"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ")
 
(38 intermediate revisions by 9 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
  
| Check if given vehicle/person/building is alive (i.e. not dead or destroyed). |= Description
+
|game4= arma2
____________________________________________________________________________________________
+
|version4= 1.00
  
| '''alive''' object |= Syntax
+
|game5= arma2oa
 +
|version5= 1.50
  
|p1= object: [[Object]] to test |= Parameter 1
+
|game6= tkoh
 +
|version6= 1.00
  
| [[Boolean]]: true when alive, false when dead |= Return value
+
|game7= arma3
____________________________________________________________________________________________
+
|version7= 0.50
 
+
 
|x1= <pre>?!(alive player) : exit</pre> |= Example 1
+
|arg= global
____________________________________________________________________________________________
 
  
| [[setDamage]], [[damage]] |= See also
+
|gr1= Object Manipulation
  
}}
+
|descr= Check if given vehicle/person/building is alive (i.e. not dead or destroyed).
 +
{{Feature|Informative|{{ic|[[alive]] [[objNull]] {{cc|returns [[false]]}}}}}}
  
<h3 style="display:none">Notes</h3>
+
|s1= [[alive]] object
<dl class="command_description">
 
<!-- Note Section BEGIN -->
 
Returns 'BOOL' if the object does'nt exists. For example in multiplayer when a object is removed alive will return 'BOOL' if a new player join after the object were destroyed.
 
  
--
+
|p1= object: [[Object]]
  
If you're determining whether a unit is still viable, you might also want to look at [[canMove]], [[canFire]] and [[canStand]]. [[User:Nomdeplume|nomdeplume]] 12:45, 16 November 2009 (CET)
+
|r1= [[Boolean]] - [[true|True]] if alive, [[false]] if dead/destroyed
 +
 
 +
|x1= SQS: <code>?!([[alive]] [[player]]) : [[exit]]</code>
  
<!-- Note Section END -->
+
|x2= SQF: <code>[[if]] (![[alive]] [[player]]) [[exitWith]] {};</code>
</dl>
 
  
<h3 style="display:none">Bottom Section</h3>
+
|seealso= [[setDamage]], [[damage]]
 +
}}
  
[[Category:Scripting Commands|ALIVE]]
+
<dl class="command_description">
[[Category:Scripting Commands OFP 1.96|ALIVE]]
+
<dt></dt>
[[Category:Scripting Commands OFP 1.46|ALIVE]]
+
<dd class="notedate">Posted on October 19, 2015 - 23:48 (UTC)</dd>
[[Category:Scripting Commands ArmA|ALIVE]]
+
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
+
<dd class="note">
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
+
Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, (alive player) will return false, then almost immediately true if the "revive" respawn template is enabled, then could turn on false if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns. Just be aware that in that case (respawn + revive enabled), the status of the player is toggling: true false true false true. Then, alive status while player is waiting for being rescued could lead to some error scripts as player is supposed to be alive but  in limbo and the dead entity "player" passed to server.
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
+
</dd>
 +
</dl>

Latest revision as of 15:56, 3 May 2021

Hover & click on the images for descriptions

Description

Description:
Check if given vehicle/person/building is alive (i.e. not dead or destroyed).
alive objNull // returns false

Syntax

Syntax:
alive object
Parameters:
object: Object
Return Value:
Boolean - True if alive, false if dead/destroyed

Examples

Example 1:
SQS: ?!(alive player) : exit
Example 2:
SQF: if (!alive player) exitWith {};

Additional Information

See also:
setDamagedamage
Groups:
Object Manipulation

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
Posted on October 19, 2015 - 23:48 (UTC)
Pierre MGI
Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, (alive player) will return false, then almost immediately true if the "revive" respawn template is enabled, then could turn on false if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns. Just be aware that in that case (respawn + revive enabled), the status of the player is toggling: true false true false true. Then, alive status while player is waiting for being rescued could lead to some error scripts as player is supposed to be alive but in limbo and the dead entity "player" passed to server.