Nazwa forum

Opis forum


#1 2009-06-22 10:47:43

Agent

Administrator

Zarejestrowany: 2009-06-22
Posty: 26
Punktów :   

Trapowanie

Trapowanie garnkami (albo innymi itemami, wystarczy zmienic ITEMID w const na id itema), w const wpisujemy: w NICK nazwa playera ktorego chcemy trapn±ć i DELAY, gdzie wpisujemy jaki ma być odstep czasu między rzuceniem itemu)


Kod:
const
   DELAY = 500;
   NICK = 'tu wpisac nick gracza;
   ITEMID = 3465;

function getPlayer(name:string) : Creature;
begin
for i := 0 to Creatures.Count - 1 do
   begin
      if Creatures.Creature[i].name = name then
      begin
         result := Creatures.Creature[i];
         exit;
      end;
   end;
end;

function getItem : item;
var
   i,j:integer;
begin
   for i:=0 to self.containers.count -1 do
   begin
      for j:=0 to self.containers.container[i].count -1 do
         if self.containers.container[i].item[j].id = ITEMID then
         begin
            result := self.containers.container[i].item[j];
            exit;
         end;
   end;
end;

procedure trap(name:string);
var
   i,j:integer;
   target : creature;
   pot : item;
begin
   updateworld;
   target := getPlayer(name);
   if target > nil then
   begin
      for i:=-1 to 1 do
      begin
         for j:=-1 to 1 do
            if not ((j=0) and (i=0)) then
               begin
                  updateworld;
                  pot := getItem;
                  if pot >=0 then
                  begin 
                     pot.movetoground(target.x+i,target.y+j,target.z,1);
                     sleep(DELAY);
            end else exit; 
         end;
      end;
   end;
end;

begin
   trap(NICK);
end;

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.metinboty.pun.pl www.nightwolves-guild.pun.pl www.lwiaziemiaijejstado.pun.pl www.zssf.pun.pl www.eurotop.pun.pl