Jump to content
McKay Development

Using .createOffer() with variables


Recommended Posts

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);
}
}
});

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...