Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

IsContainer

Returns True if the specified object is a container, False otherwise.

ObjID — ID of the object to check.

Returns False if the object does not exist or the character is disconnected.

Возвращает True, если указанный объект является контейнером, иначе False.

ObjID — ID объекта для проверки.

Возвращает False, если объект не существует или персонаж не подключён.

Pascal

function IsContainer(ObjID: Cardinal): Boolean;

Python

def IsContainer(ObjID: int) -> bool: ...

Pascal Example

begin
  if FindType($0E76, Ground) > 0 then
  begin
    if IsContainer(FindItem) then
      AddToSystemJournal('Found a container on the ground')
    else
      AddToSystemJournal('Found item is not a container');
  end;
end.

Python Example

if FindType(0x0E76, Ground()) > 0:
    if IsContainer(FindItem()):
        AddToSystemJournal('Found a container on the ground')
    else:
        AddToSystemJournal('Found item is not a container')

See Also

GetContent, GetType, IsObjectExists