PlayerIsSpectator

From Zandronum Wiki
Revision as of 17:27, 21 August 2016 by DrinkyBird (talk | contribs) (Created page with "{{Template:ACSWarning}} int '''PlayerIsSpectator''' (int ''player'') ==Usage== Takes one argument, which is the player number it uses and returns the spectator status. ====...")
(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 PlayerIsSpectator (int player)

Usage

Takes one argument, which is the player number it uses and returns the spectator status.

Return value

  • 0 if the player is not a spectator
  • 1 if the player is a true spectator
  • 2 if the player is a dead spectator (when a player was killed and waits for the round to end to respawn)

Examples

Script 1 (int player) DISCONNECT
{
    if (!PlayerIsSpectator(player))
    {
        PrintBold(s: "Someone disconnected.");
    }
    else if (PlayerIsSpectator(player))
    {
        PrintBold(s: "Someone became a spectator.");
    }
}