Page 1 of 1

[CS:GO] how to get the number of real people in the team

Posted: Tue Apr 30, 2019 9:48 am
by copyerfiled
Hello!
How to get the number of real people in the team? (without bots)

Re: [CS:GO] how to get the number of real people in the team

Posted: Tue Apr 30, 2019 3:30 pm
by Kami
Hey, this is how you could do it:

Syntax: Select all

def get_real_player_count(team_number):
count = 0
for player in PlayerIter('human'):
if player.team == team_number:
count += 1
return count


Available filters for PlayerIter should be:

Code: Select all

'all',
'bot',
'human',
'alive',
'dead',
'un',
'spec',
't',
'ct'

Re: [CS:GO] how to get the number of real people in the team

Posted: Tue Apr 30, 2019 3:47 pm
by Ayuto
That could be shortened to:

Syntax: Select all

from filters.players import PlayerIter

def get_real_player_count(team):
return len(PlayerIter(['human', team]))
The team argument is one of the filters Kami has listed above.

Re: [CS:GO] how to get the number of real people in the team

Posted: Tue Apr 30, 2019 5:01 pm
by copyerfiled
Thank you all very much!