Difference between revisions of "alive"

From Bohemia Interactive Community
Jump to navigation Jump to search
(example)
m (Text replacement - "|= Game version" to "|Game version=")
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{Command|Comments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| ofp |= Game name
+
| ofp |Game name=
  
|1.00|= Game version
+
|1.00|Game version=
  
|arg= global |= Arguments in MP
+
|arg= global |Multiplayer Arguments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| Check if given vehicle/person/building is alive (i.e. not dead or destroyed). |= Description
+
| Check if given vehicle/person/building is alive (i.e. not dead or destroyed). [[alive]] [[objNull]] returns [[false]]. |DESCRIPTION=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| '''alive''' object |= Syntax
+
| '''alive''' object |SYNTAX=
  
|p1= object: [[Object]] to test |= Parameter 1
+
|p1= object: [[Object]] to test |PARAMETER1=
  
| [[Boolean]]: true when alive, false when dead |= Return value
+
| [[Boolean]]: true when alive, false when dead |RETURNVALUE=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 
   
 
   
|x1= SQS: <code>?!([[alive]] [[player]]) : [[exit]]</code> |= Example 1
+
|x1= SQS: <code>?!([[alive]] [[player]]) : [[exit]]</code> |EXAMPLE1=
|x2= SQF: <code>[[if]] (![[alive]] [[player]]) [[exitWith]] {};</code> |= Example 2
+
|x2= SQF: <code>[[if]] (![[alive]] [[player]]) [[exitWith]] {};</code> |EXAMPLE2=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| [[setDamage]], [[damage]] |= See also
+
| [[setDamage]], [[damage]] |SEEALSO=
  
 
}}
 
}}
Line 29: Line 29:
 
<h3 style="display:none">Notes</h3>
 
<h3 style="display:none">Notes</h3>
 
<dl class="command_description">
 
<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.
 
  
--
 
 
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)
 
 
<!-- Note Section END -->
 
 
</dl>
 
</dl>
  
Line 51: Line 44:
 
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]
 
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]
 +
 +
<!-- CONTINUE Notes -->
 +
<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>
 +
<!-- DISCONTINUE Notes -->

Latest revision as of 02:21, 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:
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 when alive, false when dead

Examples

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

Additional Information

Multiplayer:
-
See also:
setDamagedamage

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

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.