View Single Post
06-02-09, 10:20 PM   #6
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Originally Posted by Nirrudn View Post
You can get the raid leader by doing something like this:
The problem with that is that other people could spam the RL by clicking the button. The addon should respond to whoever actually sent the request, which you get as part of the CHAT_MSG_ADDON event. The above code *would* be a good way to confirm if that person is the RL, although I would modify it a little bit to:

Code:
for i = 1, 40 do
    local name,rank = GetRaidRosterInfo(i)
    if name == sender and rank > 1 then --sender will have already been set to whoever sent the request
         --display your frame with the request
         break
    end
end

Last edited by Akryn : 06-02-09 at 10:33 PM.
  Reply With Quote