Difference between revisions of "alive"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
 
(33 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|ALIVE]]
+
{{Command|Comments=
[[Category:Scripting Commands OFP 1.96|ALIVE]]
+
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|ALIVE]]
 
[[Category:Scripting Commands ArmA|ALIVE]]
 
  
 +
| ofp |Game name=
  
<h2 style="color:#000066">'''alive ''obj'''''</h2>
+
|1.00|Game version=
  
 +
|arg= global |Multiplayer Arguments=
 +
____________________________________________________________________________________________
  
'''Operand types:'''
+
| Check if given vehicle/person/building is alive (i.e. not dead or destroyed).
 +
{{Informative | {{Inline code|[[alive]] [[objNull]] {{cc|returns [[false]]}}}}}}|DESCRIPTION=
 +
____________________________________________________________________________________________
  
'''obj:''' [[Object]]
+
| [[alive]] object |SYNTAX=
  
'''Type of returned value:'''
+
|p1= object: [[Object]] to test |PARAMETER1=
  
[[Boolean]]
+
| [[Boolean]] - [[true]] if alive, [[false]] if dead/completely destroyed |RETURNVALUE=
 +
____________________________________________________________________________________________
 +
 
 +
|x1= SQS: <code>?!([[alive]] [[player]]) : [[exit]]</code> |EXAMPLE1=
  
'''Description:'''
+
|x2= SQF: <code>[[if]] (![[alive]] [[player]]) [[exitWith]] {};</code> |EXAMPLE2=
 +
____________________________________________________________________________________________
  
Check if given person, vehicle or building is not dead / destroyed.
+
| [[setDamage]], [[damage]] |SEEALSO=
 +
}}
  
 +
<h3 style="display:none">Notes</h3>
 +
<dl class="command_description">
 +
<dd class="notedate">Posted on October 19, 2015 - 23:48 (UTC)</dd>
 +
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
 +
<dd class="note">
 +
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.
 +
</dd>
 +
</dl>
  
'''Example:'''
+
<h3 style="display:none">Bottom Section</h3>
 
+
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
? ('''alive''' player) : _b = 1
+
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Command_Group: Object Information|{{uc:{{PAGENAME}}}}]]

Latest revision as of 17:46, 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:
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 to test
Return Value:
Boolean - true if alive, false if dead/completely destroyed

Examples

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

Additional Information

See also:
setDamagedamage

Notes

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

Notes

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.

Bottom Section