Page 1 of 1

[SCRIPT] Intelispawn

Posted: Tue Jun 25, 2013 5:34 pm
by thepolm3
This script changes the respawn time based on the number of players on that team
for e.g
respawn time is 10s
12 players on blue
8 players on green
12 / 8 = 1.5
10 * 1.5 = 15
blue team spawns is 15
green team spawn is 10
Code: Select all
print("Here's the code)
Code: Select all
"""
cahnges the respawn time based on number of players
thepolm3
"""

def apply_script(protocol, connection, config):
    
    class InteliSpawnConnection(connection):

        #ok so i condenced this. So sue me
        def get_respawn_time(self):
            respawn_time=connection.get_respawn_time(self)
            blue,green=self.protocol.blue_team,self.protocol.green_team
            blues=greens=0.0
            for player in self.protocol.players.values():
                if player.team==blue: blues+=1.0
                elif player.team==green: greens+=1.0
            if blues!=0 and greens>blues and self.team==green: return int(greens/blues)*respawn_time
            if greens!=0 and blues>greens and self.team==blue: return int(greens/blues)*respawn_time
            return respawn_time
        
    return protocol, InteliSpawnConnection

Re: [SCRIPT] Intelispawn

Posted: Wed Jun 26, 2013 12:31 am
by TB_
*standard comment complementing your script-making skills*

Yeah, I feel like I'm getting a bit repetive when replying to these posts. But thanks a bunch for this too!