ObjAtLayerEx
Returns the serial (ID) of the item equipped on the specified layer of the given mobile.
LayerType — the layer index (see ConstantsAndEnums). Helper methods that return layer values are documented separately in Layers. If 0, returns 0 immediately.
PlayerID — ID of the mobile to check.
Returns 0 if no item is equipped on the specified layer, the mobile does not exist, or the character is disconnected.
Возвращает серийный номер (ID) предмета, экипированного в указанном слое заданного мобайла.
LayerType — индекс слоя (см. ConstantsAndEnums). Вспомогательные методы, возвращающие значения слоёв, вынесены на отдельную страницу: Layers. Если 0, сразу возвращает 0.
PlayerID — ID мобайла для проверки.
Возвращает 0, если на указанном слое нет экипированного предмета, мобайл не существует или персонаж не подключён.
function ObjAtLayerEx(LayerType: Byte; PlayerID: Cardinal): Cardinal;
def ObjAtLayerEx(Layer: int, ObjID: int) -> int: ...
var
WeaponID: Cardinal;
begin
WeaponID := ObjAtLayerEx(RhandLayer, LastTarget);
if WeaponID <> 0 then
AddToSystemJournal('Target weapon: $' + IntToHex(WeaponID, 8) +
' type: $' + IntToHex(GetType(WeaponID), 4))
else
AddToSystemJournal('Target has no weapon in right hand');
end.
weapon_id = ObjAtLayerEx(RhandLayer(), LastTarget())
if weapon_id != 0:
AddToSystemJournal(f'Target weapon: ${weapon_id:08X} type: ${GetType(weapon_id):04X}')
else:
AddToSystemJournal('Target has no weapon in right hand')