SetDeadSpectator

From Zandronum Wiki
Revision as of 02:08, 11 January 2019 by Mr. Satan (talk | contribs) (Created page with "{{Template:ACSWarning}} int '''SetDeadSpectator'''(int playernumber, bool state) ==Usage== Turns a player that is alive into a dead spectator or vice versa. This function wi...")
(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 SetDeadSpectator(int playernumber, bool state)

Usage

Turns a player that is alive into a dead spectator or vice versa. This function will only effect Dead Spectators or players that are alive, not True Spectators. If sv_DeadPlayersCanKeepInventory is set, the Dead Spectator will be resurrected with the inventory he had before he died. If sv_SameSpawnSpot is set and you are using Zandronum 3.1 the Dead Spectator will be resurrected at his current location.

Parameters

  • playernumber: Number of the player to effect
  • state: The state to set on the effected player (1 DeadSpectator, 0 Alive)

Examples

This script will turn the selected player into Dead Spectator if he is alive, or resurrect him if he is a Dead Spectator.

script 29999 (int pnum)
{
  if (PlayerIsSpectator(pnum) == 0) { SetDeadSpectator(pnum,1); }
  else if (PlayerIsSpectator(pnum) == 2) {  SetDeadSpectator(pnum,0); }
}