Jump to content
McKay Development

Recommended Posts

Posted

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

Posted

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

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...