[SCRIPT] Intelispawn

Intended for use on live public servers.
2 posts Page 1 of 1 First unread post
thepolm3
Scripter
Scripter
Posts: 424
Joined: Sat Feb 16, 2013 10:49 pm


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
Attachments
intelispawn.py
(876 Bytes) Downloaded 242 times
TB_
Post Demon
Post Demon
Posts: 998
Joined: Tue Nov 20, 2012 6:59 pm


*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!
2 posts Page 1 of 1 First unread post
Return to “Completed Releases”

Who is online

Users browsing this forum: No registered users and 1 guest