Advertisement
Guest User

Untitled

a guest
Jun 30th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.89 KB | None | 0 0
  1. var
  2. delay: Array [1..32] of shortint;
  3. kill: array [1..32] of boolean;
  4. letskill: boolean;
  5. ticker: byte;
  6. i, amount1, amount2, j, k: byte;
  7. alphaspawnstyle, bravospawnstyle : array [0..255] of byte;
  8.  
  9.  
  10.     letskill := true;
  11.     kill[id] := true;
  12.  
  13. end;
  14.  
  15.  
  16. procedure OnJoinTeam(ID, Team: byte);
  17. begin
  18.     delay[ID] := 2;
  19. end;
  20.  
  21. procedure AppOnIdle(Ticks: integer);
  22. var
  23. x,y, lowestdistance:single;
  24. begin
  25.  
  26. if Ticks mod (7 * 30) = 0 then if ticker > 0 then ticker := ticker - 1;
  27. if (ticker > 3) and (numplayers = 0) then begin
  28.     Command('/nextmap');
  29.     WriteLn('Could not load map bug detected, next map is coming!');
  30. end
  31.  
  32. for i := 1 to 32 do begin
  33.   if (delay[i] > 0) then
  34.   delay[i] := delay[i] - 1;
  35.   if (delay[i] = 1) then begin
  36.     if GetPlayerStat(i,'Flagger') then begin
  37.     Command('/kill ' +inttostr(i));
  38.     WriteConsole(i, 'Antibug script has killed you.', $00EE76);
  39.     end
  40.   end
  41.   end
  42.  
  43. if letskill then begin
  44.     for i := 1 to 32 do if kill[i] and (GetPlayerStat(i,'Active') = true) then begin
  45.         kill[i] := false;
  46.         if GetPlayerStat(i,'Team') = 1 then begin
  47.             lowestdistance := 99999999;
  48.             GetPlayerXY(i,X,Y);
  49.             for j:=1 to amount1 do begin
  50.                 if Distance(x,y,GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y')) < lowestdistance then begin
  51.                     lowestdistance := Distance(x,y,GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y'));
  52.                 end
  53.             end;           
  54.             if lowestdistance > 500 then begin
  55.                 DoDamage(i,4000);
  56.                 WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76);
  57.                 WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.');
  58.             end
  59.         end
  60.         else if GetPlayerStat(i,'Team') = 2 then begin
  61.             lowestdistance := 99999999;
  62.             GetPlayerXY(i,X,Y);
  63.             for j:=1 to amount1 do begin
  64.                 if Distance(x,y,GetSpawnStat(bravospawnstyle[j],'x'),GetSpawnStat(bravospawnstyle[j],'y')) < lowestdistance then begin
  65.                     lowestdistance := Distance(x,y,GetSpawnStat(bravospawnstyle[j],'x'),GetSpawnStat(bravospawnstyle[j],'y'));
  66.                 end
  67.             end;           
  68.             if lowestdistance > 500 then begin
  69.                 DoDamage(i,4000);
  70.                 WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76);
  71.                 WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.');
  72.             end
  73.         end
  74.     end
  75.     letskill := false;
  76. end
  77.  
  78. end;
  79.  
  80.  
  81. procedure OnMapChange(NewMap: string);
  82. var
  83.   i: byte;
  84. begin
  85.  
  86. amount1 := 0;
  87. amount2 := 0;
  88.   for k:= 1 to 254 do begin
  89.       if GetSpawnStat(k,'Style') = 1 then begin
  90.         amount1 := amount1 + 1;
  91.         alphaspawnstyle[amount1] := k;
  92.       end
  93.     end
  94.   for k:= 1 to 254 do begin
  95.     if GetSpawnStat(k,'Style') = 2 then begin
  96.         amount2 := amount2 + 1;
  97.         bravospawnstyle[amount2] := k;
  98.     end
  99.   end
  100.  
  101. if numplayers > 0 then begin
  102.   for i := 1 to 32 do begin
  103.     kill[i] := true;
  104.   end
  105.   letskill := true;
  106. end
  107. end;
  108.  
  109. function OnRequestGame(IP: string; State: integer): integer;
  110. begin
  111.     if NumPlayers = 0 then begin
  112.         ticker := ticker + 1;
  113.     end
  114. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement