alive: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 92507 by pierremgi on 2015-10-19T23:48:52Z)
No edit summary
 
(43 intermediate revisions by 3 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). [[alive]] [[objNull]] returns [[false]]. |= 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= SQS: <code>?!([[alive]] [[player]]) : [[exit]]</code> |= Example 1
|x2= SQF: <code>[[if]] (![[alive]] [[player]]) [[exitWith]] {};</code> |= Example 2
____________________________________________________________________________________________


| [[setDamage]], [[damage]] |= See also
|arg= global


}}
|gr1= Object Manipulation
 
|descr= Check if given vehicle/person/building is alive (i.e. not dead or destroyed).
 
|s1= [[alive]] object
 
|p1= object: [[Object]]
 
|r1= [[Boolean]] - [[true]] if alive, [[false]] if dead/destroyed


<h3 style="display:none">Notes</h3>
|x1= SQS:
<dl class="command_description">
<sqs>? not alive player : exit</sqs>


</dl>
|x2= SQF:
<sqf>if (!alive player) exitWith {};</sqf>


<h3 style="display:none">Bottom Section</h3>
|x3= <sqf>alive objNull; // returns false</sqf>


[[Category:Scripting Commands|ALIVE]]
|seealso= [[setDamage]] [[damage]] [[waterDamaged]]
[[Category:Scripting Commands OFP 1.99|ALIVE]]
}}
[[Category:Scripting Commands OFP 1.96|ALIVE]]
[[Category:Scripting Commands OFP 1.46|ALIVE]]
[[Category:Scripting Commands ArmA|ALIVE]]
[[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}}}}]]
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= Pierre MGI
<dd class="notedate">Posted on October 19, 2015 - 23:48 (UTC)</dd>
|timestamp= 20151019234800
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
|text= Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, <sqf inline>alive player</sqf> will return false, then almost immediately true if the "revive" respawn template is enabled, then could turn to false again if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns.
<dd class="note">
Just be aware that in that case (respawn + revive enabled), the status of the player is toggling: true &rarr; false &rarr; true &rarr; false &rarr; true. Then, alive status while player is waiting for being rescued could lead to some script errors as player is supposed to be alive but is in limbo and the dead entity "player" gets passed to server.
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>
<!-- DISCONTINUE Notes -->

Latest revision as of 16:50, 12 February 2023

Hover & click on the images for description

Description

Description:
Check if given vehicle/person/building is alive (i.e. not dead or destroyed).
Groups:
Object Manipulation

Syntax

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

Examples

Example 1:
SQS:
? not alive player : exit
Example 2:
SQF:
if (!alive player) exitWith {};
Example 3:
alive objNull; // returns false

Additional Information

See also:
setDamage damage waterDamaged

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
Pierre MGI - c
Posted on Oct 19, 2015 - 23:48 (UTC)
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 to false again 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 script errors as player is supposed to be alive but is in limbo and the dead entity "player" gets passed to server.