PlayerHealth: Difference between revisions
DrinkyBird (talk | contribs) (Created page with "{{Template:ACSWarning}} int '''PlayerHealth''' (void) ==Usage== Returns the amount of health the activator of the script has. Returns zero if the activator is world. This i...") |
DrinkyBird (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
Returns the amount of health the activator of the script has. Returns zero if the activator is world. | Returns the amount of health the activator of the script has. Returns zero if the activator is world. | ||
This is equivalent to '''{{ | This is equivalent to '''{{Zdoomwiki|GetActorProperty}}''' (0, APROP_Health) | ||
==Examples== | ==Examples== | ||
<syntaxhighlight lang="c" line="1"> | |||
Script 1 (void) | |||
{ | |||
if (PlayerHealth() > 75) | |||
{ | |||
Print(s: "You have a lot of health!"); | |||
} | |||
else | |||
{ | |||
Print(s: "You might want to find a medkit!"); | |||
} | |||
} | |||
</syntaxhighlight> | |||
[[category:ACS Functions]] | [[category:ACS Functions]] |
Revision as of 15:15, 21 August 2016
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports. |
int PlayerHealth (void)
Usage
Returns the amount of health the activator of the script has. Returns zero if the activator is world.
This is equivalent to GetActorProperty (0, APROP_Health)
Examples
Script 1 (void)
{
if (PlayerHealth() > 75)
{
Print(s: "You have a lot of health!");
}
else
{
Print(s: "You might want to find a medkit!");
}
}