Jump to content
McKay Development

Recommended Posts

Posted

Hello,

 

can you tell me, how to make conditions for:

 

 

You have logged in from a new device. In order to protect the items in your inventory, you will be unable to trade from this device for 7 days.

 

Is it possible to make a condition that immediately rejects a bid on any mistake by Steam? I tried to list (offer.state) in (console.log) and always I get = 2 (to this error message - You have logged....).

function processOffer(offer) {
    if (offer.isGlitched() || offer.state === 11) {
        //console.log("Offer was glitched, declining.");
        declineOffer(offer);
    } else if (offer.partner.getSteamID64() === config.ownerID) {
        acceptOffer(offer);
        var item = ourItems[i].market_name;
    } else {

     //my_code

    }
function acceptOffer(offer) {
    offer.accept((err) => {
        community.checkConfirmations();
        //console.log("We Accepted an offer");
        if (err); //console.log("There was an error accepting the offer.");
    });
}
 
function declineOffer(offer) {
    offer.decline((err) => {
        //console.log("We Declined an offer");
        if (err); //console.log("There was an error declining the offer.");
    });
}

Thanks for help and answer.

  • 3 weeks later...
Posted

That processOffer should be like this:

function processOffer(offer, oldstate) {
    if (offer.isGlitched() || (offer.state === 11 && oldstate == 2)) {
        //console.log("Offer was glitched, declining.");
        declineOffer(offer);
    } else if (offer.partner.getSteamID64() === config.ownerID) {
        acceptOffer(offer);
        var item = ourItems[i].market_name;
    } else {

     //my_code

    }

And at the event 'sentOfferChanged' you should put the function:

processOffer(offer, oldstate);

Note: On the event 'sentOfferChanged' put the oldstate to be same as on the processOffer 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...