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

RenameMobile

Sends a rename request for the specified mobile to the server.

MobID — serial (ID) of the mobile to rename.

NewName — the new name to assign.

Renaming is only possible for mobiles that the server allows renaming (typically pets owned by the player). The server will silently reject the request if the mobile cannot be renamed. Use MobileCanBeRenamed to check beforehand.

Does nothing if the character is not connected.

Отправляет серверу запрос на переименование указанного мобайла.

MobID — serial (ID) мобайла для переименования.

NewName — новое имя.

Переименование возможно только для мобайлов, для которых сервер разрешает переименование (обычно — собственные питомцы игрока). Сервер молча отклонит запрос, если мобайл не может быть переименован. Используйте MobileCanBeRenamed для предварительной проверки.

Не выполняет действий, если персонаж не подключён.

Pascal

procedure RenameMobile(MobID: Cardinal; NewName: String);

Python

def RenameMobile(MobID: int, NewName: str) -> None: ...

Pascal Example

begin
  if MobileCanBeRenamed(FindItem) then
  begin
    RenameMobile(FindItem, 'MyPet');
    AddToSystemJournal('Renamed mobile to MyPet');
  end
  else
    AddToSystemJournal('Cannot rename this mobile');
end.

Python Example

if MobileCanBeRenamed(FindItem()):
    RenameMobile(FindItem(), 'MyPet')
    AddToSystemJournal('Renamed mobile to MyPet')
else:
    AddToSystemJournal('Cannot rename this mobile')

See Also

MobileCanBeRenamed, GetName, GetAltName