Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

WoWInterface » Developer Discussions » Lua/XML Help » Getting a players class from name


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off