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

GetZ

Returns the Z coordinate (height) of the object or mobile with the given ObjID.

ObjID — ID of the object or mobile.

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

Возвращает координату Z (высоту) объекта или мобила с указанным ObjID.

ObjID — ID объекта или мобила.

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

Pascal

function GetZ(ObjID: Cardinal): ShortInt;

Python

def GetZ(ObjID: int) -> int: ...

Pascal Example

begin
  AddToSystemJournal('My Z: ' + IntToStr(GetZ(Self)));
  AddToSystemJournal('Surface Z: ' + IntToStr(GetSurfaceZ(GetX(Self), GetY(Self), WorldNum)));
end.

Python Example

AddToSystemJournal(f'My Z: {GetZ(Self())}')
AddToSystemJournal(f'Surface Z: {GetSurfaceZ(GetX(Self()), GetY(Self()), WorldNum())}')

See Also

GetX, GetY, GetSurfaceZ