Author Topic: FlagsKiller  (Read 3082 times)

0 Members and 1 Guest are viewing this topic.

Offline Savage

  • Soldier
  • **
  • Posts: 155
FlagsKiller
« on: February 15, 2017, 05:47:07 pm »
Script Name: FlagsKiller
Script Description: Kills the flags.
Original Author(s): Savage
Compilation: Passed
Core Version: 2.8.1 (SC3)

Code: [Select]
//FlagsKiller by Savage

procedure OnFlagGrab(Player: TActivePlayer; TFlag: TActiveFlag; Team: Byte; GrabbedInBase: Boolean);
var
i, KillCounter: Byte;
begin
Map.RedFlag.Kill;
Map.BlueFlag.Kill;

for i := 1 to 255 do
if (Map.Spawns[i].Style = 5) or (Map.Spawns[i].Style = 6) then begin
Inc(KillCounter, 1);
Map.Spawns[i].Active := False;
if KillCounter = 2 then
break;
end;
end;

procedure Init;
var
i: Byte;
begin
for i := 1 to 32 do
Players[i].OnFlagGrab := @OnFlagGrab;
end;

begin
Init;
end.