Author Topic: Question here  (Read 726 times)

0 Members and 1 Guest are viewing this topic.

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Question here
« on: March 29, 2009, 11:52:32 am »
Code: [Select]
var
    nocaps: boolean;
    timer : array[1..32] of integer;
    i: integer;

procedure ActivateServer();
begin
 nocaps := true;
end;
procedure ReturnFlag(Team : byte);
var n, k : byte;
begin
    n := SpawnObject(0, 0, 1);
    KillObject(n);
    for i := 1 to n - 1 do begin
        if (GetObjectStat(k, 'Style') = Team) then begin
            KillObject(k);
            break;
        end;
    end;
end;

for i := 1 to 32 do
        if timer[I] > 0 then begin
                timer[I] := timer[I] - 1;
                if timer[I] = 0 then
                        WriteConsole(i,'Your flag vanishes...',SomeColour);
                        ReturnFlag(//I dunno what i need to enter here//);
        end;     
procedure OnFlagGrab(ID, TeamFlag: byte;GrabbedInBase: boolean);
begin
  if nocaps then begin
    timer[ID] := 5;
  end;
end;

Actually what I am trying to do is do ReturnFlag procedure after timer reaches zero(if nocaps true)
But my code fails and i have no idea how to fix this:

1. Return exact flag (if alpha captures blue flag it returns and the same for bravo team) after timer reaches zero.

2. In addition, if value of NumPlayers reaches limit(for example 4) nocaps gets it value false.

Thanks for further advices or help  ::)

ReturnFlag procedure by J-Factor
« Last Edit: March 29, 2009, 11:54:11 am by Irlandec »

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Question here
« Reply #1 on: March 29, 2009, 01:04:02 pm »

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Question here
« Reply #2 on: March 30, 2009, 03:40:27 am »
http://forums.soldat.pl/index.php?topic=22216.0

Like I have it in the script  :)

Quote
...to do is do ReturnFlag procedure after timer reaches zero

I dont know how to add team check for "I" in AppOnIdle(if i use ReturnFlag(i); procedure fails).



Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Question here
« Reply #3 on: March 31, 2009, 06:35:09 am »
Can someone help me plz?