Wikia

WoWWiki

Changes: API GetGuildBankTabPermissions

Edit

Back to page

(Page creation)
 
m (added a note, fixed some typos)
 
Line 6: Line 6:
 
=== Arguments ===
 
=== Arguments ===
   
:;tab : Number - guild bank tab number
+
:;tab : Integer - guild bank tab number
   
 
=== Returns ===
 
=== Returns ===
 
:;canView : [[Boolean]] - 1 if the selected rank can view this guild bank tab, nil otherwise.
 
:;canView : [[Boolean]] - 1 if the selected rank can view this guild bank tab, nil otherwise.
 
:;canDeposit : [[Boolean]] - 1 if the selected rank can deposit to this guild bank tab, nil otherwise.
 
:;canDeposit : [[Boolean]] - 1 if the selected rank can deposit to this guild bank tab, nil otherwise.
:;stacksPerDay : [[Integer]] - Amount of withdrawable stacks per day or 0 if none.
+
:;stacksPerDay : Integer - Amount of withdrawable stacks per day or 0 if none.
   
 
== Example ==
 
== Example ==
Line 17: Line 17:
 
local canView, canDeposit, stacksPerDay = GetGuildBankTabPermissions(1);
 
local canView, canDeposit, stacksPerDay = GetGuildBankTabPermissions(1);
 
if canDeposit then
 
if canDeposit then
DEFAULT_CHAT_FRAME:AddMessage("Can view, deposit and retrieve " .. stacksPerDay .. " stacks a day on tab 1.")
+
DEFAULT_CHAT_FRAME:AddMessage("Can view, deposit and retrieve " .. stacksPerDay .. " stacks a day on tab 1.");
 
elseif canView then
 
elseif canView then
DEFAULT_CHAT_FRAME:AddMessage("Can view and retrieve " .. stacksPerDay .. " stacks a day on tab 1.")
+
DEFAULT_CHAT_FRAME:AddMessage("Can view and retrieve " .. stacksPerDay .. " stacks a day on tab 1.");
 
else
 
else
DEFAULT_CHAT_FRAME:AddMessage("Can not view tab 1.")
+
DEFAULT_CHAT_FRAME:AddMessage("Can not view tab 1.");
 
end
 
end
 
=== Result ===
 
=== Result ===
   
 
: If you are the guild master, this will return data for the rank you currently have selected in guild control. Else, it will return data for your own rank.
 
: If you are the guild master, this will return data for the rank you currently have selected in guild control. Else, it will return data for your own rank.
  +
  +
: Guild masters can always view, deposit and withdraw without limits; this function does not properly return that. Use [[API IsGuildLeader|IsGuildLeader]](UnitName("player")) if you want to know if this is the case.
   
 
: Note that being able to deposit implies being able to view.
 
: Note that being able to deposit implies being able to view.

Latest revision as of 19:38, November 15, 2007

WoW API < GetGuildBankTabPermissions
canView, canDeposit, stacksPerDay = GetGuildBankTabPermissions(tab);

Parameters Edit

Arguments Edit

tab 
Integer - guild bank tab number

Returns Edit

canView 
Boolean - 1 if the selected rank can view this guild bank tab, nil otherwise.
canDeposit 
Boolean - 1 if the selected rank can deposit to this guild bank tab, nil otherwise.
stacksPerDay 
Integer - Amount of withdrawable stacks per day or 0 if none.

Example Edit

local canView, canDeposit, stacksPerDay = GetGuildBankTabPermissions(1);
if canDeposit then
 DEFAULT_CHAT_FRAME:AddMessage("Can view, deposit and retrieve " .. stacksPerDay .. " stacks a day on tab 1.");
elseif canView then
 DEFAULT_CHAT_FRAME:AddMessage("Can view and retrieve " .. stacksPerDay .. " stacks a day on tab 1.");
else
 DEFAULT_CHAT_FRAME:AddMessage("Can not view tab 1.");
end

Result Edit

If you are the guild master, this will return data for the rank you currently have selected in guild control. Else, it will return data for your own rank.
Guild masters can always view, deposit and withdraw without limits; this function does not properly return that. Use IsGuildLeader(UnitName("player")) if you want to know if this is the case.
Note that being able to deposit implies being able to view.

Around Wikia's network

Random Wiki