Es getlivingplayercount

From EventScripts Community Encyclopedia


Overview

Syntax: es_getlivingplayercount <variable> [team number]

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: es_xgetlivingplayercount

Description

Similar to es_getplayercount, but only counts players that are not dead.

Parameters

  • variable - name of the variable you want to save the living player count.
  • team number - optional parameter to specify which team you want. 2 - Terrorists, 3 - Counter Terrorists


Examples

// Get the total number of living players and store in the variable "alive"
es_getlivingplayercount alive
// Get the total number of living Terrorists and store in the variable "alive_ts"
es_getlivingplayercount alive_ts 2


Notes

  • Note: Valve takes a second or two to register a player as fully dead, so this value is not so reliable in player_death, etc.


See also

blog comments powered by Disqus