Gulshan Jangid Posted July 26, 2017 Report Posted July 26, 2017 (edited) I use trade link to send offer to a user not in my friend list. I add their items to the offer using the item id, it successfully adds and sends the offer. But when I see the trade offer it contains only 1 item even if I have sent more than 1. Have a look at the code below (here itemsArray contains the id of items),it was working fine when I used steamid to create tradeOffer instead of tradeUrl, but that was limited to my friend list only: const offer = manager.createOffer(tradeUrl); manager.loadInventory(appid, contextid, true, (err, myInv) => { if (err) { console.log(err); } else { manager.loadUserInventory(partnerid, appid, contextid, true, (err, theirInv) => { if (err) { console.log(err); } else { for(i=0; i<itemsArray.length; i++){ const item = theirInv.find((item) => item.assetid ==''+itemsArray[i]); console.log("got item number" + i); offer.addTheirItem(item); } offer.setMessage(`somerandom message`); offer.send((err, status) => { if (err) { console.log(err); } else { console.log(`Sent offer. Status: ${status}.`); } }); } }); } }); Edited July 26, 2017 by Gulshan Jangid Quote
Gulshan Jangid Posted July 26, 2017 Author Report Posted July 26, 2017 (edited) And yeah I only add items which are tradeable, is their a problem with offer.addTheirItem(item)? Edited July 26, 2017 by Gulshan Jangid Quote
Gulshan Jangid Posted July 26, 2017 Author Report Posted July 26, 2017 I got that sorted! I was using const item, and by replacing const with var it worked! 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.