Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetGuildPermissionData

From RoR Wiki

UI Lua API · Game functions
Version: WAR 1.4.8

Returns the player's guild ranks (titles) and the permissions of each.

ranks = GetGuildPermissionData()

Arguments

None.

Returns

ranks
table – Array of rank tables, indexed from 1.

Each rank table has these fields:

Key Type Meaning
rankID number Rank number.
rankTitle wstring Title of the rank.
rankUsed boolean true if the rank is enabled.
rankQty number Number of guild members with this rank.
0, 1, 2, … boolean Permission flags, keyed by permission index from 0 (at most 62 flags).

Details

  • The permission flags are stored directly in the rank table with numeric keys. Index the table with a permission number to test it.
  • The stock UI indexes the result with a member's statusNumber + 1 (see GetGuildMemberData) and checks it for nil before use.
  • rankQty is counted from the current guild roster each time the function is called.

Errors

None.

Example

Testing a permission, from ea_guildwindow/source/guildwindowtabadmin.lua:

local guildPermissionData = GetGuildPermissionData()
if( guildPermissionData ~= nil and guildPermissionData[statusNumber + 1] ~= nil ) then
    local playerPermissions = guildPermissionData[statusNumber + 1] -- StatusNumbers are 0-9, but the LUA tables are 1-10]
    return playerPermissions[permissionIndex]
end

Listing the ranks, from the same file:

for key, value in ipairs( guildPermissionData )
...
    LabelSetText( qtyWindow, L""..value.rankQty )

See also