Code: Show/Hide Spawn:Team0-Radius = 15 Spawn:Team0-X = 512 Spawn:Team0-Y = 512 Spawn:Team1-Radius = 15 Spawn:Team1-X = 512 Spawn:Team1-Y = 512 Spawn:Team2-Radius = 0 Spawn:Team2-X = 367 Spawn:Team2-Y = 735 Spawn:Team3-Radius = 0 Spawn:Team3-X = 656 Spawn:Team3-Y = 735 Spawn:Team4-Radius = 5 Spawn:Team4-X = 143 Spawn:Team4-Y = 543 Spawn:Team5-Radius = 5 Spawn:Team5-X = 304 Spawn:Team5-Y = 543 Spawn:Team6-Radius = 5 Spawn:Team6-X = 719 Spawn:Team6-Y = 543 Spawn:Team7-Radius = 5 Spawn:Team7-X = 880 Spawn:Team7-Y = 543 Spawn:Team8-Radius = 5 Spawn:Team8-X = 111 Spawn:Team8-Y = 927 Spawn:Team9-Radius = 5 Spawn:Team9-X = 464 Spawn:Team9-Y = 927 Spawn:Team10-Radius = 5 Spawn:Team10-X = 559 Spawn:Team10-Y = 927 Spawn:Team11-Radius = 5 Spawn:Team11-X = 912 Spawn:Team11-Y = 927 |
Code: Show/Hide from asss import * game = get_interface(I_GAME) def cb_shipchange(p, newship, oldship, newfreq, oldfreq): if newship != SHIP_SPEC: if newfreq >= 2: game.WarpTo(p, x, y) else: game.WarpTo(p, 512, 512) |
Code: Show/Hide from asss import * game = get_interface(I_GAME) def shipfreqchange(p, newship, oldship, newfreq, oldfreq): if newship != SHIP_SPEC: if newfreq >= 2: game.WarpTo(p, 367, 735) if newfreq >= 3: game.WarpTo(p, 656, 735) if newfreq >= 4: game.WarpTo(p, 143, 543) if newfreq >= 5: game.WarpTo(p, 304, 543) if newfreq >= 6: game.WarpTo(p, 719, 543) if newfreq >= 7: game.WarpTo(p, 880, 543) if newfreq >= 8: game.WarpTo(p, 111, 927) if newfreq >= 9: game.WarpTo(p, 464, 927) if newfreq >= 10: game.WarpTo(p, 559, 927) if newfreq >= 11: game.WarpTo(p, 912, 927) else: game.WarpTo(p, 512, 512) def mm_attach(arena): arena.cwarp_ref1 = reg_callback(CB_SHIPFREQCHANGE, shipfreqchange, arena) def mm_detach(arena): arena.cwarp_ref1 = None |
Code: Show/Hide from asss import * game = get_interface(I_GAME) def SPAWN(p, SPAWN_AFTERDEATH, SPAWN_SHIPRESET, SPAWN_SHIPCHANGE, SPAWN_INITIAL): pass def shipfreqchange(p, newship, oldship, newfreq, oldfreq): if newship != SHIP_SPEC: if newfreq >= 2: game.WarpTo(p, 367, 735) if newfreq >= 3: game.WarpTo(p, 656, 735) if newfreq >= 4: game.WarpTo(p, 143, 543) if newfreq >= 5: game.WarpTo(p, 304, 543) if newfreq >= 6: game.WarpTo(p, 719, 543) if newfreq >= 7: game.WarpTo(p, 880, 543) if newfreq >= 8: game.WarpTo(p, 111, 927) if newfreq >= 9: game.WarpTo(p, 464, 927) if newfreq >= 10: game.WarpTo(p, 559, 927) if newfreq >= 11: game.WarpTo(p, 912, 927) else: game.WarpTo(p, 512, 512) def mm_attach(arena): arena.cwarp_ref1 = reg_callback(CB_SPAWN, shipfreqchange, arena) arena.cwarp_ref2 = reg_callback(CB_SHIPFREQCHANGE, shipfreqchange, arena) def mm_detach(arena): arena.cwarp_ref1 = None arena.cwarp_ref2 = None |
Code: Show/Hide def spawncb(p, type): if type & asss.SPAWN_AFTERDEATH > 0 or type & asss.SPAWN_SHIPCHANGE: thoseWarpThings |
Code: Show/Hide from asss import * ##SPAWN POINTS## spawn_points=[(356,735),(656,735),(143,543),(304,543),(719,543),(880,543),(111,927),(464,927),(559,927),(912,927)] chat = get_interface(I_CHAT) game = get_interface(I_GAME) def cb_spawn(player, reason): if reason == SPAWN_INITIAL or reason == SPAWN_AFTERDEATH: chat.SendArenaMessage(arena, "Would be warping") game.WarpTo(p, spawn_points[p.freq][2], spawn_points[p.freq][3], spawn_points[p.freq][4], spawn_points[p.freq][5], spawn_points[p.freq][6], spawn_points[p.freq][7], spawn_points[p.freq][8], spawn_points[p.freq][9], spawn_points[p.freq][10], spawn_points[p.freq][11]) def mm_attach(arena): arena.cwarps_ref1 = reg_callback(CB_SPAWN, cb_spawn, arena) def mm_detach(arena): arena.cwarp_ref1 = None |
Samapico wrote: |
best way would be to send custom client settings to the players, depending on their freq... so each player has a Spawn:Team0-X and Spawn:Team0-Y setting that makes them spawn somewhere. |
Code: Show/Hide from asss import * ##SPAWN POINTS## spawn_points=[(356,735),(656,735),(143,543),(304,543),(719,543),(880,543),(111,927),(464,927),(559,927),(912,927)] chat = get_interface(I_CHAT) game = get_interface(I_GAME) cfg = get_interface(I_CONFIG) class cwarps(): def __init__(self, arena): ###self.callback1=reg_callback(CB_SPAWN, self.cb_spawn, arena) self.callback1=reg_callback("spawn", self.cb_spawn, arena) self.callback2=reg_callback(CB_GLOBALCONFIGCHANGED, self.cb_readsettings, arena) self.arena=arena self.spawn_points=spawn_points self.cb_readsettings() def remref(self): self.callback1=None self.callback2=None def cb_spawn(self, p, reason): #if reason & int(SPAWN_INITIAL) or reason & int(SPAWN_AFTERDEATH): if reason & int(SPAWN_INITIAL) or reason & int(SPAWN_AFTERDEATH) or reason & int(SPAWN_SHIPCHANGE): #chat.SendMessage(p, "Would be warping") #game.WarpTo(p, spawn_points[p.freq][0], spawn_points[p.freq][1]) freq = p.freq%len(self.spawn_points) game.WarpTo(p, self.spawn_points[freq][0], self.spawn_points[freq][1]) def cb_readsettings(self): i=0 self.spawn_points=[] while True: x=cfg.GetInt(self.arena.cfg, "Spawn", "Team%s-X" % (i), 0) y=cfg.GetInt(self.arena.cfg, "Spawn", "Team%s-Y" % (i), 0) if not x or not y: return #setting doesn't exsists, guess we reached end of line self.spawn_points.append((x, y)) i+=1 def mm_attach(arena): arena.cwarps_ref = cwarps(arena) def mm_detach(arena): arena.cwarps_ref.remref() arena.cwarps_ref = None |
Samapico wrote: |
best way would be to send custom client settings to the players, depending on their freq... so each player has a Spawn:Team0-X and Spawn:Team0-Y setting that makes them spawn somewhere. |
Samapico wrote: |
Soooo.... back to the solution of sending custom client settings to each player then? |