-
Posted by moonknight on Sat, 27 Feb 2010 02:54:12
How to get the player's name which i trade?
when a player trading to me,how to get his name? my code is Right?
local frame = CreateFrame("Frame")
local function myEventHandler(self,event,...)
local arg1, arg2, arg3, arg4, arg5, arg6 = ...;
if event == "TRADE_REQUEST" then
SendChatMessage(""..arg1.."request trade","SAY","COMMON");
elseif event == "TRADE_SHOW" then
print("success")
end
end
frame:RegisterEvent("TRADE_REQUEST")
frame:RegisterEvent("TRADE_SHOW")
frame:SetScript("OnEvent",myEventHandler)
-
Posted by jnwhiteh on Sat, 27 Feb 2010 11:46:34
You should be able to get the name of the play you are trading with by querying UnitName("npc").
-
Posted by moonknight on Sat, 27 Feb 2010 15:03:26
thank you!