WoW:API GetNumGuildMembers: Difference between revisions

m
Move page script moved page API GetNumGuildMembers to WoW:API GetNumGuildMembers without leaving a redirect
(Noted that this function is bugged)
m (Move page script moved page API GetNumGuildMembers to WoW:API GetNumGuildMembers without leaving a redirect)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<p>Returns the number of guild members</p>
{{wowapi}} __NOTOC__
<hr />
Returns the total and online number of guild members.
<dl><dt><em>Arguments</em></dt></dl>
  numTotalMembers, numOnlineMaxLevelMembers, numOnlineMembers = GetNumGuildMembers();
<dl><dd>offline - boolean</dd></dl>
<hr />
<dl><dt><em>Returns</em></dt></dl>
<dl><dd>If called with no argument gets number of online guild members. If
offline argument is true get number of all guild members.</dd></dl>
<hr />
<dl><dt><em>Example</em></dt></dl>
<pre>
local numGuildMembers = GetNumGuildMembers();
local numAllGuildMembers = GetNumGuildMembers(true);
</pre>
<hr />
<dl><dt><em>Notes</em></dt></dl>
<dl><dd>This function seems to return 0 if you have not yet opened the guild roster. I suspect that a call to GuildRoster(), before calling this function will cause it to return the proper result.</dd>
<dd>This function will return a maximum value of 500.</dd></dl>
<hr />
<dl><dt><em>Warnings</em></dt></dl>
<dl><dd>If the character is not part of a guild, but has left (/gquit) one, it will still return the number of members of the guild the character was last in. This means that GetNumGuildMembers() is not a reliable way to determine if the character is in a guild or not.</dd>
</dl>
<hr />


{{Template:WoW API}}
==Parameters==
===Returns===
:;numTotalMembers
:: Integer - total number of people in the guild, or 0 if player is not in a guild.
:;numOnlineMaxLevelMembers
:: Integer - total number of people in the guild that are at the level cap, or 0 if player is not in a guild. (Does not include remote chat members)
:;numOnlineMembers
:: Integer - number of online people in the guild, or 0 if the player is not in a guild.
 
==Example==
local numTotal, numOnlineMaxLevel, numOnline = GetNumGuildMembers();
DEFAULT_CHAT_FRAME:AddMessage(numTotal .. " guild members: " .. numOnline .. " online (" .. numOnlineMaxLevel .. " at maximum level), " .. (numTotal - numOnline) .. " offline.");
===Result===
Displays the number of people online, offline, and the total headcount of your guild in the default chat frame.
 
==Notes==
You may need to call [[API_GuildRoster|GuildRoster()]] first in order to obtain correct data. May return wrong values immediately after quitting a guild. Maximum returned value is 1000.
Anonymous user