Quantcast WoWInterface - View Single Post - Get a Player's Class & Level
View Single Post
02-01-20, 03:19 PM   #5
nUI Maintainer
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,447
Say you wanted to find out about someone who whispered you...

These are the values that that event will have in its arguments
"text", "playerName", "languageName", "channelName", "playerName2", "specialFlags", zoneChannelID, channelIndex, "channelBaseName", unused, lineID, "guid", bnSenderID, isMobile, isSubtitle, hideSenderInLetterbox, supressRaidIcons

The GUID value has it's own set of values if you know how to extract it ..

The following is a quick code up and is not necessarily 100% working but should give you an idea of how you can use it.

Lua Code:
  1. function OnChatEvent(self, event, ... )
  2.    local args = { ... }
  4.    local localizedClass, englishClass, localizedRace, englishRace, sex, name, realm = GetPlayerInfoByGUID(args[12])
  6.   -- Deal with PlayerInfo as needed
  8. end
  10. local frame = CreateFrame("EventWatcher")
  11. frame:RegisterEvent("CHAT_MSG_WHISPER")
  12. frame:SetScript("OnEvent", OnChatEvent)

Last edited by Xrystal : 02-01-20 at 03:23 PM.
  Reply With Quote