View Single Post
05-06-08, 02:55 AM   #1
Oldeface
A Murloc Raider
Join Date: May 2008
Posts: 4
Getting a players class from name

How would I go about getting a players class from their name, if they are not near me (targetable), in my party, raid, guild, etc (As UnitClass() can only detect under these circumstances.)

I have a solution working, a-la /who: (where arg2= string value of players name)
PHP Code:
SendWho(arg2);
local charnameguildnamelevelrace, class = GetWhoInfo(1);

if(
tostring(class)=="Mage")
    ...
end 
Currently I've hooked the chat frame, and am parsing the arg1 strings of CHAT_MSG_SYSTEM to see if they are for the /who call and just ignore them.. the addon seemingly does this check without you knowing, however I would like another way besides having to do this workaround if possible!

Please let me know if I'm missing something.

Suggestions?

Last edited by Oldeface : 05-06-08 at 03:16 AM.
  Reply With Quote