SAIL - WantDismantle

Gotowe kody SAIL'a, informacje na temat moddingu, itd.

Moderator: zoNE

Post Reply
User avatar

Topic author
zoNE
The Great Uniter & Site Administrator
The Great Uniter & Site Administrator
Posts: 1537
Joined: Fri Feb 17, 2006 3:44 pm
Location: Poland
Contact:

SAIL - WantDismantle

#1

Post by zoNE » Tue Nov 03, 2015 10:15 pm

Serpent wrote:Na prośbę Marta napisałem funkcję która zwraca prawdę jeśli jednostka (unit) chce rozmontować budynek (building).

Code: Select all

Export Function WantDismantle(unit, building);
var x, y;
begin
x := GetX(building);
y := GetY(building);

     if GetTaskList(unit) then
        begin
        if 'Y' = GetTaskList(unit)[1][1] and
             x = GetTaskList(unit)[1][2] and
             y = GetTaskList(unit)[1][3] then
           result := true
            else
             result := false;
        end
         else
          result := false;
End;
Użycie:

Code: Select all

// ...
if WantDismantle(eng1, magazyn) then
   // akcja..
// ...
Author: Serpent
Topic: viewtopic.php?f=42&t=4543

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest