Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API GetPartyMember

From WoW Classic Wiki
GetPartyMember
memberUnitId = GetPartyMember(index);

Returns the unit Id of the specified party member if that party member exists, or nil otherwise.


Arguments
(index)
index
Number - Which party member to query (1-4)

Returns
memberUnitId
memberUnitId
Number - If the specified party member exists, returns the id of that member, otherwise returns nil

The numbers always translate directly; querying for 1 will return "party1", 2 "party2", etc, as long as that party slot is filled. This is mostly useful for testing for whether the party member in question exists. Though a more straightforward method of accomplishing that is, of course, simply calling GetNumPartyMembers().


Example


 memberCount = 0
 for groupindex = 1,MAX_PARTY_MEMBERS do
   if (GetPartyMember(groupindex)) then
     memberCount = memberCount + 1
   end
 end
Result
Will count the number of members in the party (not the best way to do that but it's a reasonable example).

Template:WoW API