def testGetmaxplayers(self):
     j = es.getmaxplayercount()
     self.failUnless(j)
     # in CS:S we know the max players is cs_team_manager index -1 
     if es.getgame() == "Counter-Strike: Source":
       q = es.getentityindex('cs_team_manager') - 1
       if q:
         self.failUnless(q==j)
 def testGetmaxplayers(self):
     j = es.getmaxplayercount()
     self.failUnless(j)
     # in CS:S we know the max players is cs_team_manager index -1
     if es.getgame() == "Counter-Strike: Source":
         q = es.getentityindex('cs_team_manager') - 1
         if q:
             self.failUnless(q == j)
Exemple #3
0
def check_player(userid):
    '''
    If there are too many players it checks if this new one has a reserved slot
    '''
    maxplayers = es.getmaxplayercount()
    pdiff = maxplayers - es.getplayercount()
    if pdiff <= int(xareserveslots.setting.getVariable("reserve_slots_number_of_slots")):
        # ok so there we are into the reserved slots...
        if returnReservedStatus(userid):
            # remember that ^^ returns true IF they do not have a reserve slot
            # The player is NOT allowed in a reserved slot so we kick them
            kickPlayer(playerlib.getPlayer(userid))
        else:
            # they are on the res list - so kick someone else??
            if int(xareserveslots.setting.getVariable("reserve_slots_allow_slot_fill")) == 0:
                #  we are not allowing the slots to fill so lets kick someone
                kickPlayer(chooseKick())
Exemple #4
0
def getmaxplayercount(argv):
  sv[argv[0]] = es.getmaxplayercount(*argv[1:])