WoW:API GetNumPartyMembers: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}} __NOTOC__
Returns number of party members.
Returns number of party members.
  numberOfPartyMembers = GetNumPartyMembers();
  partyMembers = GetNumPartyMembers()


==Parameters==
==Returns==
===Returns===
;partyMembers : Number - The number of party members, excluding the player (0 to 4).
:;numberOfPartyMembers : Integer - The number of party members - from 0 to 4 (excluding the player).


==Example==
==Example==
local n = GetNumPartyMembers();
The snippet below adds a message stating the number of people in the player's current party to the default chat frame.
  if (n > 0) then
  print("There are " .. GetNumPartyMembers() .. " other people in your party.");
  message("There are " .. n .. " other people in your party.");
end


===Result===
==Notes==
Displays a message stating the number of people in the player's current party.
* While in a battleground, this function returns information about your battleground party. You may retrieve information about your non-battleground party using {{api|GetRealNumPartyMembers}}().


==See Also==
==See Also==
* [[API GetNumRaidMembers|GetNumRaidMembers]]
* {{api|GetRealNumPartyMembers}}
* [[API GetPartyMember|GetPartyMember]]
* {{api|GetNumRaidMembers}}
* {{api|GetPartyMember}}

Revision as of 14:18, 20 June 2010

WoW API < GetNumPartyMembers

Returns number of party members.

partyMembers = GetNumPartyMembers()

Returns

partyMembers
Number - The number of party members, excluding the player (0 to 4).

Example

The snippet below adds a message stating the number of people in the player's current party to the default chat frame.

print("There are " .. GetNumPartyMembers() .. " other people in your party.");

Notes

  • While in a battleground, this function returns information about your battleground party. You may retrieve information about your non-battleground party using GetRealNumPartyMembers().

See Also