WoW:API GetPartyMember: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Fixed category link)
Line 1: Line 1:
This function returns the Index of the specified index of the player.  Thus if you used the following as an example:
<center>'''GetPartyMember'''</center>


memberId = GetPartyMember(id);
Returns the id of the specified party member if that party member exists, or <tt>nil</tt> otherwise.
----
;''Arguments''
:(id)
:;id : Number - Which party member to query (1-4)
----
;''Returns''
:memberId
:;memberId : Number - If the specified party member exists, returns the id of that member, otherwise returns <tt>nil</tt>
----
;''Example''
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
  memberCount = 0
   for groupindex = 1,4 do
   for groupindex = 1,4 do
     id=GetPartyMember(groupindex);
     if (GetPartyMember(groupindex)) then
      memberCount = memberCount + 1
    end
   end
   end


Then:
;''Result''
  id=groupindex
 
:Will count the number of members in the party (not the best way to do that but it's a reasonable example).


Thus if groupindex=1 then id=1.
----
This makes this function a noop.
{{Template:WoW API}}
[[Category:API Group Functions|GetPartyMember]]

Revision as of 23:11, 1 January 2005

GetPartyMember
memberId = GetPartyMember(id);

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


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

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

Example


 memberCount = 0
 for groupindex = 1,4 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