Tom Posted July 30, 2022 Report Share Posted July 30, 2022 (edited) Hey, im pretty new to JS and i don't know on how to get the accountData from a specific user. i know that this works, but it just gets me the accountData of my logged in account. csgo.on('accountData', (accountData) => { console.log(accountData); console.log(accountData.player_level); }); How would i make a function to call the accountData of a specific player? Like if someone writes the bot stats it gets the accountData from the player that requested it. Edited July 30, 2022 by Tom Quote Link to comment Share on other sites More sharing options...
Tom Posted July 30, 2022 Author Report Share Posted July 30, 2022 Got it running if anyone else needs it user.on('friendMessage', (steamID, message) => { if (message == 'stats') { if (csgo.haveGCSession) { const steamid = new SteamID(steamID.toString()); const final = steamid.accountid.toString(); csgo.requestPlayersProfile(steamid, function(data) { // console.log(data); user.chatMessage(steamID, 'Wins in Matchmaking: ' + data.ranking.wins + '\n' + 'Wins in Wingman: ' + data.rankings[0].wins + '\n' + 'Wins in Dangerzone: ' + data.rankings[1].wins); }); }else { user.chatMessage(steamID, 'Nö'); } } }); 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.