Author Topic: ReturnFlag  (Read 2212 times)

0 Members and 1 Guest are viewing this topic.

Offline J-Factor

  • Major(1)
  • Posts: 27
ReturnFlag
« 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:
Code: [Select]
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!
« Last Edit: November 17, 2007, 11:09:47 pm by J-Factor »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: ReturnFlag
« Reply #1 on: November 16, 2007, 03:38:44 pm »
Can be very useful, gj:)

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: ReturnFlag
« Reply #2 on: November 16, 2007, 06:56:50 pm »
lol, maybe to be used against hackers with anti-kick
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline UPNPAD

  • Major(1)
  • Posts: 36
Re: ReturnFlag
« Reply #3 on: November 17, 2007, 12:11:12 am »
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.