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