Es.getplayercount

From EventScripts Community Encyclopedia
This article is a stub. Please help by adding to it.



Method: getplayercount

Module: es
Class: (no class)
EventScripts version: 2.0

Method Overview

Table of Contents

Contents


Description

Returns the number of players on the server, or in a team

This is the Python equivalent of: http://www.eventscripts.com/pages/es_getplayercount

Arguments

  • team - (Not required) If used, it will display the number of players in the team (1 = Spectator, 2 = T, 3 = CT)


Examples

player = es.getplayercount()
es.msg("#default", "There are " + str(player) + " players on the server!")

Will display the number of players on the server

player = es.getplayercount()
cts = es.getplayercount(3)
es.msg("#default", "There are currently " + str(players) + " players on, " + str(cts) + " are CTs")

Notes

  • This function returns -1 if an error occurs (e.g. you specify a non-existent team index).
  • Counts bots as players.

See Also

es.getlivingplayercount

es.getmaxplayercount

blog comments powered by Disqus