Originally Posted by Aeriez
That actually just appears to give rank permissions.
|
Just pointing you in the right direction. It's not that much of roundabout way
Lua Code:
local members, ranks = {}, {}
local function GetPermissions()
for i = 1, GetNumGuildMembers() do
local name, _, rankIndex, _, _, _, _, _, _, _, _, _, _, _, _, _, guid = GetGuildRosterInfo(i)
members[guid] = rankIndex + 1
end
for i = 1, MAX_GUILDRANKS or 10 do
ranks[i] = C_GuildInfo.GuildControlGetRankFlags(i)
end
end
-- /dump DoesPlayerHavePermissions("target", 12)
function DoesPlayerHavePermissions(unit, flag)
if IsInGuild() then
if not next(members) then
GetPermissions()
end
local guid = UnitGUID(unit)
local member = ranks[members[guid]]
return member and member[flag]
end
end
Modify it if you want it to check against names (GGRI includes realm) instead of guids