Probably easiest way, type /aim as Admin to shoot to nearest enemy(If you need better aim... then you will need dll made by tk)
const
bspeed = 15;
bstyle = 13;
bdamage = 1000;
function NearestEnemy(const ID: Byte): Byte;
var
i,temp: Byte;
d: Single;
begin
for i := 1 to 32 do
if (i<>ID) and (Players[i].Active) and (Players[i].Alive) and ((Players[i].Team=0) or (Players[i].Team<>Players[ID].Team)) then begin
d := Distance(Players[ID].X, Players[ID].Y, Players[i].X, Players[i].Y);
temp := i;
Result := i;
break;
end;
if temp<32 then
for i := temp+1 to 32 do
if (i<>ID) and (Players[i].Active) and (Players[i].Alive) and ((Players[i].Team=0) or (Players[i].Team<>Players[ID].Team)) and (Distance(Players[ID].X, Players[ID].Y, Players[i].X, Players[i].Y)<d) then begin
d := Distance(Players[ID].X, Players[ID].Y, Players[i].X, Players[i].Y);
Result := i;
end;
end;
function OAC(Player: TActivePlayer; Command: string): boolean;
var
enemy: Byte;
x1,y1,x2,y2,d: Single;
begin
if Command='/aim' then begin
enemy := NearestEnemy(Player.ID);
if enemy<>0 then begin
x1 := Player.X;
y1 := Player.Y-12;
x2 := Players[enemy].X;
y2 := Players[enemy].Y-12;
d := Distance(x1, y1, x2, y2);
Map.CreateBullet(x1, y1, (x2-x1)/d*bspeed, (y2-y1)/d*bspeed, bdamage, bstyle, Player);
end else
Player.WriteConsole('Enemy not found',$FF0000);
end;
Result := False;
end;
begin
Game.OnAdminCommand := @OAC;
end.