IsObjectExists
Returns True if the object with the given ID exists in the local object cache, False otherwise.
ObjID — ID of the object to check.
This checks the client’s local cache, not the server. An object may exist on the server but not yet be known to the client if it is out of range.
Returns False if the character is disconnected.
Возвращает True, если объект с указанным ID существует в локальном кэше объектов, иначе False.
ObjID — ID объекта для проверки.
Проверяется локальный кэш клиента, а не сервер. Объект может существовать на сервере, но ещё не быть известным клиенту, если он находится вне зоны видимости.
Возвращает False, если персонаж не подключён.
function IsObjectExists(ObjID: Cardinal): Boolean;
def IsObjectExists(ObjID: int) -> bool: ...
var
TargetID: Cardinal;
begin
TargetID := LastTarget;
if IsObjectExists(TargetID) then
AddToSystemJournal('Target exists: ' + GetName(TargetID))
else
AddToSystemJournal('Target no longer exists');
end.
target_id = LastTarget()
if IsObjectExists(target_id):
AddToSystemJournal(f'Target exists: {GetName(target_id)}')
else:
AddToSystemJournal('Target no longer exists')