Page 1 of 1

Looking for certain eventscripts equivalents for porting stuff

Posted: Thu Dec 06, 2012 3:13 pm
by Omega_K2
es.getmaxplayercount() equivalent

Is there one?

maxClients variable doesn't seem to be exposed anyway to the python side of things.

--

A way to retrieve the player language or client variables (language is stored in cl_language, but in es you could just do es.createplaylist(userid)[userid]['language'])

--

es.stringtable('downloadables', ...) equivalnt


EDIT: Added more stuff I can't seem to find equivalents for

Posted: Thu Dec 06, 2012 4:14 pm
by Tuck
Here you go (copied from addons\source-python\_libs\players\entity.py):


Syntax: Select all

GameEngine.GetClientConVarValue(self.info, 'cl_language')

Posted: Thu Dec 06, 2012 5:25 pm
by Spiked
yeah, getting player count doesn't seem to be available.

maxplayers: only responds in KV pairs inside config files (setter only)
sv_visiblemaxplayers: set to -1 by default
maxplayers_override: only exists as a command line param

Posted: Thu Dec 06, 2012 5:50 pm
by L'In20Cible
Hey guys,

The following should work:

Syntax: Select all

from Entity import Entities
from entities.helpers import index_from_edict

def get_max_players():
for edict in Entities('cs_team_manager'):
if edict.GetPropInt('CTeam.m_iTeamNum'):
continue
return index_from_edict(edict) - 1


L'In20Cible