WoW:API GetNumGuildMembers: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
({{wowapi}}, format, example)
(typo. was online instead of offline)
Line 11: Line 11:
==Example==
==Example==
  local numOnline, numTotal = (GetNumGuildMembers()), (GetNumGuildMembers(true));
  local numOnline, numTotal = (GetNumGuildMembers()), (GetNumGuildMembers(true));
  DEFAULT_CHAT_FRAME:AddMessage(numTotal .. " guild members: " .. numOnline .. " online, " .. (numTotal - numOnline) .. " online.");
  DEFAULT_CHAT_FRAME:AddMessage(numTotal .. " guild members: " .. numOnline .. " online, " .. (numTotal - numOnline) .. " offline.");
===Result===
===Result===
Displays the number of people online, offline, and the total headcount of your guild in the default chat frame.
Displays the number of people online, offline, and the total headcount of your guild in the default chat frame.

Revision as of 07:09, 15 October 2007

WoW API < GetNumGuildMembers

Returns the number of guild members.

numGuildMembers = GetNumGuildMembers([includeOffline]);

Parameters

Arguments

includeOffline
Boolean - include offline players in the headcount?

Returns

numGuildMembers
Integer - number of people in the guild (online / both online and offline) or 0 if the player is not in a guild.

Example

local numOnline, numTotal = (GetNumGuildMembers()), (GetNumGuildMembers(true));
DEFAULT_CHAT_FRAME:AddMessage(numTotal .. " guild members: " .. numOnline .. " online, " .. (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 GuildRoster() first in order to obtain correct data. May return wrong values immediately after quitting a guild. Maximum returned value is 500.