WoW:API GetPartyMember: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
<center>'''GetPartyMember'''</center>
<center>'''GetPartyMember'''</center>


  memberId = GetPartyMember(id);
  memberUnitId = GetPartyMember(index);


Returns the id of the specified party member if that party member exists, or <tt>nil</tt> otherwise.
Returns the [[API TYPE UnitId|unit Id]] of the specified party member if that party member exists, or <tt>nil</tt> otherwise.


----
----
;''Arguments''
;''Arguments''


:(id)
:(index)
:;id : Number - Which party member to query (1-4)
:;index : Number - Which party member to query (1-4)


----
----
;''Returns''
;''Returns''


:memberId
:memberUnitId
:;memberId : Number - If the specified party member exists, returns the id of that member, otherwise returns <tt>nil</tt>
:;memberUnitId : Number - If the specified party member exists, returns the id of that member, otherwise returns <tt>nil</tt>
 
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 [[API GetNumPartyMembers|GetNumPartyMembers()]].


----
----
Line 23: Line 25:


   memberCount = 0
   memberCount = 0
   for groupindex = 1,4 do
   for groupindex = 1,MAX_PARTY_MEMBERS do
     if (GetPartyMember(groupindex)) then
     if (GetPartyMember(groupindex)) then
       memberCount = memberCount + 1
       memberCount = memberCount + 1
Anonymous user