Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- delay: Array [1..32] of shortint;
- kill: array [1..32] of boolean;
- letskill: boolean;
- ticker: byte;
- i, amount1, amount2, j, k: byte;
- alphaspawnstyle, bravospawnstyle : array [0..255] of byte;
- letskill := true;
- kill[id] := true;
- end;
- procedure OnJoinTeam(ID, Team: byte);
- begin
- delay[ID] := 2;
- end;
- procedure AppOnIdle(Ticks: integer);
- var
- x,y, lowestdistance:single;
- begin
- if Ticks mod (7 * 30) = 0 then if ticker > 0 then ticker := ticker - 1;
- if (ticker > 3) and (numplayers = 0) then begin
- Command('/nextmap');
- WriteLn('Could not load map bug detected, next map is coming!');
- end
- for i := 1 to 32 do begin
- if (delay[i] > 0) then
- delay[i] := delay[i] - 1;
- if (delay[i] = 1) then begin
- if GetPlayerStat(i,'Flagger') then begin
- Command('/kill ' +inttostr(i));
- WriteConsole(i, 'Antibug script has killed you.', $00EE76);
- end
- end
- end
- if letskill then begin
- for i := 1 to 32 do if kill[i] and (GetPlayerStat(i,'Active') = true) then begin
- kill[i] := false;
- if GetPlayerStat(i,'Team') = 1 then begin
- lowestdistance := 99999999;
- GetPlayerXY(i,X,Y);
- for j:=1 to amount1 do begin
- if Distance(x,y,GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y')) < lowestdistance then begin
- lowestdistance := Distance(x,y,GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y'));
- end
- end;
- if lowestdistance > 500 then begin
- DoDamage(i,4000);
- WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76);
- WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.');
- end
- end
- else if GetPlayerStat(i,'Team') = 2 then begin
- lowestdistance := 99999999;
- GetPlayerXY(i,X,Y);
- for j:=1 to amount1 do begin
- if Distance(x,y,GetSpawnStat(bravospawnstyle[j],'x'),GetSpawnStat(bravospawnstyle[j],'y')) < lowestdistance then begin
- lowestdistance := Distance(x,y,GetSpawnStat(bravospawnstyle[j],'x'),GetSpawnStat(bravospawnstyle[j],'y'));
- end
- end;
- if lowestdistance > 500 then begin
- DoDamage(i,4000);
- WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76);
- WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.');
- end
- end
- end
- letskill := false;
- end
- end;
- procedure OnMapChange(NewMap: string);
- var
- i: byte;
- begin
- amount1 := 0;
- amount2 := 0;
- for k:= 1 to 254 do begin
- if GetSpawnStat(k,'Style') = 1 then begin
- amount1 := amount1 + 1;
- alphaspawnstyle[amount1] := k;
- end
- end
- for k:= 1 to 254 do begin
- if GetSpawnStat(k,'Style') = 2 then begin
- amount2 := amount2 + 1;
- bravospawnstyle[amount2] := k;
- end
- end
- if numplayers > 0 then begin
- for i := 1 to 32 do begin
- kill[i] := true;
- end
- letskill := true;
- end
- end;
- function OnRequestGame(IP: string; State: integer): integer;
- begin
- if NumPlayers = 0 then begin
- ticker := ticker + 1;
- end
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement