0 Members and 1 Guest are viewing this topic.
constTEAMSWITCH_ON = 1;   //choose between 0/1 to turn off/on scriptfunction IDtoTeam(PlayerID: integer):integer;begin case PlayerID of  1: Result:= Player_Team_1;  2: Result:= Player_Team_2;  3: Result:= Player_Team_3;  4: Result:= Player_Team_4;  5: Result:= Player_Team_5;  6: Result:= Player_Team_6;  7: Result:= Player_Team_7;  8: Result:= Player_Team_8;  9: Result:= Player_Team_9;  10: Result:= Player_Team_10;  11: Result:= Player_Team_11;  12: Result:= Player_Team_12;  13: Result:= Player_Team_13;  14: Result:= Player_Team_14;  15: Result:= Player_Team_15;  16: Result:= Player_Team_16;  17: Result:= Player_Team_17;  18: Result:= Player_Team_18;  19: Result:= Player_Team_19;  20: Result:= Player_Team_20;  21: Result:= Player_Team_21;  22: Result:= Player_Team_22;  23: Result:= Player_Team_23;  24: Result:= Player_Team_24;  25: Result:= Player_Team_25;  26: Result:= Player_Team_26;  27: Result:= Player_Team_27;  28: Result:= Player_Team_28;  29: Result:= Player_Team_29;  30: Result:= Player_Team_30;  31: Result:= Player_Team_31;  32: Result:= Player_Team_32; end;end;procedure TeamSwitch();var i: integer;begin if TEAMSWITCH_ON = 1 then begin  for i:= 1 to NumPlayers+NumBots do begin   case IDtoTeam(i) of    1: command('/setteam2 '+inttostr(i));    2: command('/setteam1 '+inttostr(i));   end;  end; end;end;procedure AppOnIdle(Ticks: integer);begin if(TimeLeft+1=TimeLimit*60) then TeamSwitch();end;procedure OnCommand(ID: integer;Text: string);begin if Text = '/teamswitch' then begin  TeamSwitch(); end; if ContainsString(Text,'/map ') then TeamSwitch();end;
I think this should only be useful for INF, because the teams on CTF don't really matter unless the map is extremely unbalanced.
this is a nice scrip. a one like this only that makes teams on random would be cool
Quote from: colby on January 07, 2007, 12:55:20 amthis is a nice scrip. a one like this only that makes teams on random would be coolI agree, one that makes random teams after each round would be handy. Many people have asked for this as a server-side feature but scripting is exactly what should be used to do it.