Andrewp232 Posted August 27, 2017 Report Posted August 27, 2017 My goal is to add a specified amount of case keys to a trade offer and then send it. I'm stuck on identifying how many keys a user has and sending them a trade offer for the amount of keys called using the "amount" parameter in the function. I'd appreciate some help as I am VERY new to programming. My work: https://pastebin.com/9AwThrc0 Regards,Andrew Quote
Dr. McKay Posted August 27, 2017 Report Posted August 27, 2017 The amount parameter is only applicable for stackable items, like Steam gems. CS:GO keys are not stackable, so you will need to add the individual items separately. Quote
Andrewp232 Posted August 27, 2017 Author Report Posted August 27, 2017 Would you mind giving me an example of adding a key to a trade offer, thanks Quote
Dr. McKay Posted August 27, 2017 Report Posted August 27, 2017 There are examples in the GitHub repo. Quote
Andrei Elvis Posted August 28, 2017 Report Posted August 28, 2017 Would you mind giving me an example of adding a key to a trade offer, thanks You can do something like: var keysToAdd = [] // ARRAY WITH THE ASSETIDS OF THE KEYS. for(var i in keysToAdd) { offer.addMyItem({ 'appid': appid, 'contextid': contextid, 'assetid': keysToAdd[i] }); } //YOU NEED TO ADD THIS BEFORE <offer.send> function 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.