Jump to content

PlayerHealth: Difference between revisions

no edit summary
(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...")
 
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 '''{{ZDW|GetActorProperty}}''' (0, APROP_Health)
This is equivalent to '''{{Zdoomwiki|GetActorProperty}}''' (0, APROP_Health)


==Examples==
==Examples==


script 1 (void)
<syntaxhighlight lang="c" line="1">
{
Script 1 (void)
  if ([[PlayerHealth]]() > 75)
{
      {{zdw|Print}}(s:"You have a lot of health!");
    if (PlayerHealth() > 75)
  else
    {
      {{zdw|Print}}(s:"You might want to find a medkit!");
        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]]