PlayerHealth

From Zandronum Wiki
Revision as of 00:33, 3 July 2022 by DrinkyBird (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int PlayerHealth (void)

Usage

Return value

Returns the amount of health the activator of the script has. Returns zero if the activator is world.

This function 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!");
    }
}