McMuffinDK Posted December 18, 2017 Report Posted December 18, 2017 I have this code to get the items of a specific user, but it should work for every user in the world, so i want to use a variable instead of hardcoding the steamID64 into it, but i just can't get it to work var qqdata = steamID64; // the steamid64 of the user i want to get the inventory from const offer = manager.createOffer + qqdata; offer.getPartnerInventoryContents(730, 2, (err, inventory) => { if (err) { console.log(err); } else { for (var i = 0; i < inventory.length; i++) { setTimeout(function (i) { var name = "'" + inventory[i].market_hash_name + "'"; var image = "'" + inventory[i].icon_url + "'"; var sql = "INSERT INTO `inventorys`.`" + qqdata + "` (name, icon_url) VALUES (" + name + ", " + image + ")"; con.query(sql, function (err) { if (err) { console.log(err); } }); }, 10 * i, i); } } }); Quote
Dr. McKay Posted December 18, 2017 Report Posted December 18, 2017 Change line 3 to const offer = manager.createOffer(qqdata); Quote
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.