0 Members and 4 Guests are viewing this topic.
{$VERSION 2.6.5}varflagger_red, flagger_blue : integer;procedure ActivateServer();var i : integer;beginFlagger_red := 0;Flagger_blue := 0;end;procedure AppOnIdle(Ticks: integer);beginif GetPlayerStat(Flagger_red,'Flagger') = false then flagger_red := 0;if GetPlayerStat(Flagger_blue,'Flagger') = false then flagger_blue := 0;end;procedure OnJoinTeam(ID, Team: byte);beginif ID = Flagger_red then Flagger_red := 0 elseif ID = Flagger_blue then Flagger_blue := 0;if Team = 1 then Command('/setteam3 '+inttostr(ID))else if Team = 2 then Command('/setteam4 '+inttostr(ID));end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);beginif ID = Flagger_red then Flagger_red := 0 elseif ID = Flagger_blue then Flagger_blue := 0;end;procedure ShowCapture(ID,TeamFlag : byte);beginWriteConsole(0,idtoname(ID)+' captured the '+iif(GetPlayerStat(ID,'Team') = 3,'Red','Blue')+' Flag',iif(GetPlayerStat(ID,'Team') = 3,RGB(255,255,0),RGB(0,244,0)));DrawText(0,iif(GetPlayerStat(ID,'Team') = 3,'Charlie','Delta')+' captured the '+iif(TeamFlag = 1,'Red','Blue')+' Flag',330,iif(GetPlayerStat(ID,'Team') = 3,RGB(255,255,0),RGB(0,244,0)),0.12,20,400);end;procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);beginif TeamFlag = 1 then begin Flagger_red := Id; ShowCapture(ID,TeamFlag); end;if TeamFlag = 2 then begin Flagger_blue := Id; ShowCapture(ID,TeamFlag); end;if (Flagger_red = Flagger_blue) and (Flagger_red > 0) then begin KillObject(1); KillObject(2); If GetPlayerStat(Flagger_Red,'team') = 3 then begin WriteConsole(0,'Alpha [Charlie] Team scores',RGB(255,0,0)); DrawText(0,'Alpha [Charlie] Team scores',330,RGB(255,0,0),0.12,20,400); SetTeamScore(1,AlphaScore+1); Flagger_red := 0; Flagger_blue := 0; end; If GetPlayerStat(Flagger_Red,'team') = 4 then begin WriteConsole(0,'Bravo [Delta] Team scores',RGB(0,0,255)); DrawText(0,'Bravo [Delta] Team scores',330,RGB(0,0,255),0.12,20,400); SetTeamScore(2,Bravoscore+1); Flagger_red := 0; Flagger_blue := 0; end; end;end;procedure OnFlagDrop(ID, TeamFlag: byte);beginif TeamFlag = 1 then Flagger_red := 0;If TeamFlag = 2 then Flagger_blue := 0;end;procedure OnMapChange(NewMap: string);var i : integer;beginFlagger_red := 0;Flagger_blue := 0;for i := 1 to 254 do begin if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 3) then SetSpawnStat(i,'active',false); if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 4) then SetSpawnStat(i,'active',false); if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 1) then SetSpawnStat(i,'style',3); if (GetSpawnStat(i,'active') = true) and (GetSpawnStat(i,'style') = 2) then SetSpawnStat(i,'style',4); end;end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);beginif Victim = Flagger_red then Flagger_red := 0 elseif Victim = Flagger_blue then Flagger_blue := 0;end;
If I recall correctly, there is a 'bug' where you return a flag or something not expected (forget exactly what) if your holding the alpha flag, trying to pick up the bravo flag when the bravo flag is near it's spawn (but when not, it works fine; maybe multiple spawns may fix) (for charlie / delta / probably dm as well teams when no ctf)