WoW:API GetPartyMember: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
m (Move page script moved page API GetPartyMember to API GetPartyMember without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This function returns the Index of the specified index of the playerThus if you used the following as an example:
{{wowapi}} __NOTOC__
Returns 1 if the specified party member exists, nil otherwise.
  memberExists = GetPartyMember(index);


  for groupindex = 1,4 do
==Parameters==
    id=GetPartyMember(groupindex);
===Arguments===
:;index : Number - Which party member to query (1-4).
===Returns===
:;memberExists: Flag - If the specified party member exists, returns 1, otherwise <tt>nil</tt>.
 
==Example==
memberCount = 0
for groupindex = 1,MAX_PARTY_MEMBERS do
  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.

Latest revision as of 04:46, 15 August 2023

WoW API < GetPartyMember

Returns 1 if the specified party member exists, nil otherwise.

memberExists = GetPartyMember(index);

Parameters[edit]

Arguments[edit]

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

Returns[edit]

memberExists
Flag - If the specified party member exists, returns 1, otherwise nil.

Example[edit]

memberCount = 0
for groupindex = 1,MAX_PARTY_MEMBERS do
 if (GetPartyMember(groupindex)) then
  memberCount = memberCount + 1
 end
end

Result[edit]

Will count the number of members in the party (not the best way to do that but it's a reasonable example).