Jump to content


Photo
Question

Friends count

friends

Best Answer Dr. McKay , 09 June 2019 - 10:38 PM

Oh yeah, it's an object. Object.keys(client.myFriends).filter(steamID => client.myFriends[steamID] == SteamUser.EFriendRelationship.Friend).length

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 outo

outo

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 09 June 2019 - 09:56 AM

client.on("friendsList", function(){


    console.log(client.myFriends);


});

If I use this code I get a list.

How can I get a integer number?

Thank you!



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,101 posts

Posted 09 June 2019 - 09:15 PM

client.myFriends.length



#3 outo

outo

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 09 June 2019 - 09:35 PM

client.on("friendsList", function(){
    druzya=client.myFriends;
    console.log(druzya);
});


client.on("friendsList", function(){
    console.log(client.myFriends.length);
});
I tried it before.
but if i use this code for some reason I get "undefined"
 
ea20e622.jpg


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,101 posts

Posted 09 June 2019 - 10:38 PM   Best Answer

Oh yeah, it's an object. Object.keys(client.myFriends).filter(steamID => client.myFriends[steamID] == SteamUser.EFriendRelationship.Friend).length







Also tagged with one or more of these keywords: Question, friends

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users