Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: J-Factor on November 16, 2007, 02:00:46 am
-
Script Name: ReturnFlag(Team : byte)
Script Description: Returns a Flag to its spawn position. Team determines which team's flag is returned:
   1 = Alpha Flag
   2 = Bravo Flag
   3 = Point Match Flag
Original Author(s): J-Factor
Core Version: 2.6.3
Code:
procedure ReturnFlag(Team : byte);
var n, i : byte;
begin
  n := SpawnObject(0, 0, 1);
  KillObject(n);
  for i := 1 to n - 1 do begin
    if (GetObjectStat(i, 'Style') = Team) then begin
      KillObject(i);
      break;
    end;
  end;
end;
Colour formatted and commented version: http://nopaste.org/p/acAMPZDTl
Zip archive attached.
Notes: It's a pretty simple code snippet, but quite helpful. This even works if someone is holding the flag!
-
Can be very useful, gj:)
-
lol, maybe to be used against hackers with anti-kick
-
Maybe have a different script that doesn't let a hacker grab the flag in the first place if enough people vote for him not to be able to get the flag.