mouzes1 Posted August 12, 2016 Report Posted August 12, 2016 (edited) Here is the case1. First trade offer I am sending from bot to user item 'CS:GO Case Key' but he does not accepting it yet2. Second trade was requested and bot sending to user2 item 'CS:GO Case Key' but it is in trade offer 1 two. 3. And when some of the users accept trade offer one of offers is in "InvalidItems" state.How can I prevent this? Is there a property in CEconItem which tell us that item is in trade already?Something like this (dummy code): offers[roundBot].loadInventory(730, 2, true, function (err, myItems) { for (var i = 0; i < myItems.lenght; i++) { if (myItems[i].isAvailable == 1) { itemsToSendArray.push(myItems[i]); } } } Edited August 12, 2016 by mouzes1 Quote
yellowish Posted August 12, 2016 Report Posted August 12, 2016 (edited) For that purpose, you use tradeoffer-manager's getOffersContainingItems() function. bot.manager.getOffersContainingItems(invItem, false, function(err, sent, received) { if (sent.length > 0) { /* item is pending */ } }) Edited August 12, 2016 by yellowish 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.