Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ScanInventories2(users){ // users is an array containing the SteamID's im loading
- const appid = 730; //csgo
- const contextid = 2;
- let MaxKeys = [];
- for(var i=0; i<users.length;i++){
- let KeysCounted =0;
- let MaxIndex = 0; //
- let SteamID = users[i]; // The user we're scanning
- manager.getUserInventoryContents(SteamID,appid,contextid,true,(err, theirInv) => {
- if (err) { //Error loading inventory
- console.log("["+getTime()+"] " +err);
- }
- let InvLength = theirInv.length
- for(var x=0;x<InvLength;x++){
- let useritem = theirInv[x].market_hash_name;
- if(ScannedInventories.Keys[useritem]){ //Checking if it's the item i'm looking for
- KeysCounted++;
- }
- }
- console.log(KeysCounted); // Prints to see if it has a value, and it does!
- MaxKeys.push(KeysCounted); // Item is never added to my array.
- });
- }
- return MaxKeys;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement