Lightning Blade
BETA Tester
I was wondering how I would with or without Eluna get the players account name with my addon.
-- Addon:
local function ONADDONMSG(self, event, prefix, msg, Type, sender)
if (event == "CHAT_MSG_ADDON" and prefix == "Your Prefix") then
if(sender == UnitName("player")) then -- Only accept the player's own addon messages
print(msg) -- prints the account name
end
end
end
local MsgReceiver = CreateFrame("Frame")
MsgReceiver:RegisterEvent("CHAT_MSG_ADDON")
MsgReceiver:SetScript("OnEvent", ONADDONMSG)
-- Eluna:
local msg = tostring(player:GetAccountId())
player:SendAddonMessage("Your Prefix", msg, 7, player)
Mark as solved