chnel Posted October 30, 2016 Report Posted October 30, 2016 (edited) Hi there,i've been doing some tries as hobby and i wanted to share with you. I believe it will be usefull. before read or copying the code just consider some valuable;♦manager is a call from TradeOfferManager, so you will need to replace atleast tags. var manager = new TradeOfferManager({"steam":client,"domain":"google.com","language":"en"}); function getInv(sTeamID,itmName){ manager.loadUserInventory(sTeamID,730,2,false,function(err,inventory) { if(err) { console.log("[WARNING]: Couldn't load inventory of " + sTeamID + "!"); } else { console.log(sTeamID+"inventory loaded"); for (var p = 0;p<inventory.length;p++) { if(inventory[p].market_hash_name == itmName) { return inventory[p].assetid; } else { console.log(sTeamID+"item could not found"); return false; } } } })}How to use : explanation of valuables; sTeamID : is the steamid of the person who own's that inventory.itmName : is the item that you want to get assetid you need to set here market_hash_name. Example using : var hisItem = getInv("[U:1:00000000]","P2000 | Fire Elemental (Factory New)"); That will return to you asset id with that you can easily send trade offers.Also you can combine with https://dev.doctormckay.com/topic/643-function-that-sends-offer-basic/ this to send trade easy as well. Note : that function have been written for CSGO if you want to use this for other apps just edit the appid with yours or you could add a valuable to function and send it while calling the function. Edited October 30, 2016 by chnel Quote
Dr. McKay Posted October 30, 2016 Report Posted October 30, 2016 That will not work. You can't return a value from an outer function from within a callback. 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.