0 Members and 2 Guests are viewing this topic.
procedure OnFlagScore(ID, TeamFlag: Byte);var i: Integer;begin // if its alpha flag if TeamFlag = 1 then begin // First, move all to bravo for i := 1 to 32 do Command('/setteam2 ' + inttostr(i)); // Then, repeat this loop until someone is on alpha while AlphaPlayers < 1 do Command('/setteam1 ' + inttostr(Random(1, 32))); end;end;
i suppose he's trying to avoid the colour bug. You could move all the players to spec first, store their IDs in an array and then move them to bravo in AppOnIdle
Quote from: danmer on April 03, 2008, 02:39:10 pmi suppose he's trying to avoid the colour bug. You could move all the players to spec first, store their IDs in an array and then move them to bravo in AppOnIdleWhats the color bug? Whenever I setteamed, unless it deals with setting a player to team 0, it seemed the players are the proper color..
search 'returnflag' in scripting releases forum
Well, this should do it. Only that instead of leaving someone on alpha, it moves all to bravo and then moves a random player back. Code: [Select]procedure OnFlagScore(ID, TeamFlag: Byte);var i: Integer;begin // if its alpha flag if TeamFlag = 1 then begin // First, move all to bravo for i := 1 to 32 do Command('/setteam2 ' + inttostr(i)); // Then, repeat this loop until someone is on alpha while AlphaPlayers < 1 do Command('/setteam1 ' + inttostr(Random(1, 32))); end;end;I haven't tested it, but it should work. Or at least give you an idea on how to do it.
SetTeamScore(1, AlphaScore + 1)
// This will run every time a player is killedprocedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin // if the victim is on team two, move to team one if GetPlayerStat(Victim, 'Team') = 2 then begin Command('/setteam1 ' + IntToStr(Victim)); end; // this will also work (without begin/end, it just does the first line after) if GetPlayerStat(Victim, 'Team') = 2 then Command('/setteam1 ' + IntToStr(Victim));end;