outo Posted June 9, 2019 Report Share Posted June 9, 2019 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! Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 10, 2019 Report Share Posted June 10, 2019 client.myFriends.length Quote Link to comment Share on other sites More sharing options...
outo Posted June 10, 2019 Author Report Share Posted June 10, 2019 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" Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted June 10, 2019 Report Share Posted June 10, 2019 Oh yeah, it's an object. Object.keys(client.myFriends).filter(steamID => client.myFriends[steamID] == SteamUser.EFriendRelationship.Friend).length Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.