Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ScanInventories2(users){ // users is an array containing the SteamID's im loading
  2.     const appid = 730; //csgo
  3.     const contextid = 2;
  4.     let MaxKeys = [];
  5.    
  6.     for(var i=0; i<users.length;i++){
  7.         let KeysCounted =0;
  8.         let MaxIndex = 0; //
  9.         let SteamID = users[i]; // The user we're scanning
  10.         manager.getUserInventoryContents(SteamID,appid,contextid,true,(err, theirInv) => {
  11.             if (err) { //Error loading inventory
  12.                 console.log("["+getTime()+"] " +err);
  13.             }
  14.             let InvLength = theirInv.length
  15.             for(var x=0;x<InvLength;x++){
  16.                 let useritem = theirInv[x].market_hash_name;
  17.                 if(ScannedInventories.Keys[useritem]){ //Checking if it's the item i'm looking for
  18.                     KeysCounted++;
  19.                 }
  20.             }
  21.                 console.log(KeysCounted); // Prints to see if it has a value, and it does!
  22.                 MaxKeys.push(KeysCounted); // Item is never added to my array.
  23.         });
  24.     }
  25.         return MaxKeys;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement