Get a Player's Class & Level
Hello,
I want to get a player's class/color and level from their chat message but I wasn't able to do it as I tried UnitClass() and UnitLevel(), but these seem to only work for me(even if I entered my name), player, target, party, raid...etc and not players out of my range. I would really appreciate help with this. Thanks. |
A player's level is not available from just a chat event. The only way you used to get it is from convoluted usage of the /who api, but both retail and classic now has that protected behind a hardware event.
For class info, pass the 12th argument from the chat event, the player's GUID, into GetPlayerInfoByGUID. |
Thanks a lot, Kanegasi.
|
Hey,
Do you mind giving me all the arguments that I can pass in that function? I only know about the first few up to channel name, so I'd appreciate it if you could give me a link or something that shows me more. Thanks. |
Say you wanted to find out about someone who whispered you...
These are the values that that event will have in its arguments https://wow.gamepedia.com/CHAT_MSG_WHISPER "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 .. https://wow.gamepedia.com/GUID 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:
|
Thank you, got it to work now.
|
All times are GMT -6. The time now is 03:44 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI