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, если объект не существует, не является мобайлом или персонаж не подключён.
function MobileCanBeRenamed(MobID: Cardinal): Boolean;
def MobileCanBeRenamed(MobID: int) -> bool: ...
begin
if MobileCanBeRenamed(LastTarget) then
begin
RenameMobile(LastTarget, 'MyPet');
AddToSystemJournal('Pet renamed');
end
else
AddToSystemJournal('Cannot rename this mobile');
end.
if MobileCanBeRenamed(LastTarget()):
RenameMobile(LastTarget(), 'MyPet')
AddToSystemJournal('Pet renamed')
else:
AddToSystemJournal('Cannot rename this mobile')