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

GetTradeOpponentName

Returns the name of the opponent in the specified secure trade window.

TradeNum — index of the active trade window (1-based, as returned by TradeCount).

Returns an empty string if the trade window does not exist or the character is disconnected.

Возвращает имя оппонента в указанном окне безопасного обмена.

TradeNum — индекс активного окна обмена (начиная с 1, как возвращает TradeCount).

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

Pascal

function GetTradeOpponentName(TradeNum: Byte): String;

Python

def GetTradeOpponentName(TradeNum: int) -> str: ...

Pascal Example

begin
  if TradeCount > 0 then
  begin
    AddToSystemJournal('Trading with: ' + GetTradeOpponentName(1));
    AddToSystemJournal('Opponent serial: $' + IntToHex(GetTradeOpponent(1), 8));
  end;
end.

Python Example

if TradeCount() > 0:
    AddToSystemJournal(f'Trading with: {GetTradeOpponentName(1)}')
    AddToSystemJournal(f'Opponent serial: ${GetTradeOpponent(1):08X}')

See Also

GetTradeOpponent, GetTradeContainer, TradeCount, ConfirmTrade, CancelTrade