Zobacz pojedynczy post
stary 25-09-2008, 08:45   #7335
galdzik
Użytkownik Forum
 
Data dołączenia: 25 08 2008

Posty: 18
Stan: Zbanowany
Profesja: Royal Paladin
Gildia: Bellators~
Świat: Iridia
Poziom: 142
Domyślny

var
LockID:integer;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

begin
updateworld;
while self.attacking=0 do
begin
sleep(200);
updateworld;
end;
LockID:=self.attacking;
while not terminated do
begin
updateworld;
ProcessEvents;
if ((self.attacking)<>(LockID)) and ((self.attacking)<>(0)) then
LockID:=Self.Attacking;
If Self.Attacking=0 then
begin
Creature:=GetCreatureByID(LockID);
If Creature<>nil then Creature.Attacking:=true;
end;

sleep(100);
end;
end
galdzik jest offline   Odpowiedz z Cytatem