SetPlayerLivesLeft: Difference between revisions

From Zandronum Wiki
(Created page with "{{ACSWarning}} int '''SetPlayerLivesLeft''' (int ''player'', int ''amount'') *''player'': the player to set the lives for. Setting ''player'' to ''PlayerNumber()'' will refe...")
 
No edit summary
Tag: Source edit
 
Line 1: Line 1:
{{ACSWarning}}
{{ACSWarning}}


int '''SetPlayerLivesLeft''' (int ''player'', int ''amount'')
bool '''SetPlayerLivesLeft''' (int ''player'', int ''amount'')


*''player'': the player to set the lives for. Setting ''player'' to ''PlayerNumber()'' will refer to the activator of the script.
== Usage ==
*''amount'': amount of lives left to set.
=== Parameters ===
* ''player'': the player to set the lives for.
* ''amount'': the amount of lives the player has left after they die. Lives are only reduced on respawning; to give a player 3 lives, an amount of 2 should be used. An amount of 0 indicates last life.


Returns 1 for success, 0 for failure (e.g. if the player does not exist). ''amount'' is the amount of lives the player has left after he dies. Lives are only reduced on respawning; to give a player 3 lives, an amount of 2 should be used. An amount of 0 indicates last life.
=== Return value ===
Returns true for success, false for failure (e.g. if the player does not exist).


[[Category: ACS Functions]]
== Examples ==
{{noexamples}}
 
== See also ==
* [[GetPlayerLivesLeft]]
 
[[Category: ACS functions]]

Latest revision as of 01:03, 3 July 2022

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

bool SetPlayerLivesLeft (int player, int amount)

Usage

Parameters

  • player: the player to set the lives for.
  • amount: the amount of lives the player has left after they die. Lives are only reduced on respawning; to give a player 3 lives, an amount of 2 should be used. An amount of 0 indicates last life.

Return value

Returns true for success, false for failure (e.g. if the player does not exist).

Examples

This article lists no examples, please add one.

See also