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

MobileCanBeRenamed

Returns True if the specified mobile can be renamed (e.g., a pet or follower), False otherwise.

MobID — ID of the mobile to check.

The method checks both the mobile flag and the renamable flag on the object.

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

Возвращает True, если указанный мобайл может быть переименован (например, пет или фолловер), иначе False.

MobID — ID мобайла для проверки.

Метод проверяет как флаг мобайла, так и флаг возможности переименования объекта.

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

Pascal

function MobileCanBeRenamed(MobID: Cardinal): Boolean;

Python

def MobileCanBeRenamed(MobID: int) -> bool: ...

Pascal Example

begin
  if MobileCanBeRenamed(LastTarget) then
  begin
    RenameMobile(LastTarget, 'MyPet');
    AddToSystemJournal('Pet renamed');
  end
  else
    AddToSystemJournal('Cannot rename this mobile');
end.

Python Example

if MobileCanBeRenamed(LastTarget()):
    RenameMobile(LastTarget(), 'MyPet')
    AddToSystemJournal('Pet renamed')
else:
    AddToSystemJournal('Cannot rename this mobile')

See Also

RenameMobile, IsNPC, GetName