Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
({{wowapi}})
mNo edit summary
Line 1: Line 1:
 
{{wowapi}} __NOTOC__
 
{{wowapi}} __NOTOC__
 
Returns how many friends you have.
 
Returns how many friends you have.
numberOfFriends = GetNumFriends()
+
numberOfFriends, onlineFriends = GetNumFriends()
   
 
== Parameters ==
 
== Parameters ==
 
=== Returns ===
 
=== Returns ===
 
:;numberOfFriends : Integer - The number of friends you have (i.e. the highest valid friend index you can use to get friend information).
 
:;numberOfFriends : Integer - The number of friends you have (i.e. the highest valid friend index you can use to get friend information).
  +
:;onlineFriends : Integer - The number of online friends.
   
 
== Example ==
 
== Example ==
DEFAULT_CHAT_FRAME:AddMessage("I've got " .. GetNumFriends() .. " friend(s)");
+
DEFAULT_CHAT_FRAME:AddMessage("I've got " .. (GetNumFriends()) .. " friend(s)");
 
==== Result ====
 
==== Result ====
 
Displays the number of friends you currently have in the default chat frame.
 
Displays the number of friends you currently have in the default chat frame.

Revision as of 06:05, 24 June 2010

Returns how many friends you have.

numberOfFriends, onlineFriends = GetNumFriends()

Parameters

Returns

numberOfFriends
Integer - The number of friends you have (i.e. the highest valid friend index you can use to get friend information).
onlineFriends
Integer - The number of online friends.

Example

DEFAULT_CHAT_FRAME:AddMessage("I've got " .. (GetNumFriends()) .. " friend(s)");

Result

Displays the number of friends you currently have in the default chat frame.