Just check on log in
same for inventoryCode:if(player.getBank().contains(item id)) { player.getBank().removeAll(item id); }
|
Okay , well do someone know if there is way to remove items fro eco?
Like not whole ecoreset, just one item from everyone?
also i need help with this:
If you trade with someone, after u have used some commands, etc ::train ::home, so its not open trade screen?
Etc like
Player a trading with b.
B doing ::train and after he start teleing, then he click accept trade request.
Is there way to block it ?
Just check on log in
same for inventoryCode:if(player.getBank().contains(item id)) { player.getBank().removeAll(item id); }
Do you want to remove the item completely out of the economy and that it never returns or do you want to reset the item and later on make it useable for players again?
For the trade screen add a boolean (You might already have one, check for something like isBanking) and in the teleport command add a check if the player is trading or not.
Two ways I can think off right now:
1# Add a boolean which is saved to the player files which indicates if the player has been 'searched' or not, if not it should search its inventory/bank for the item and if the item is there delete it. Then after the search set the boolean to true so the next time the player logs in it will not search again.
2# Create a account scanner and manual/automaticly remove it from the files by scanning for the item id. This can only be done easy if you dont have your player files crypted or compressed. Doing this manual would be easy.
Make a check if the player your about to trade with is nearby in the method that displays the trade interface. You might can leech this from other methods like the check if a object is nearby or a NPC.
Go to Client.java and search for:
Inside of that method find a 'good' place and put the following code:Code:void initialize OR boolean initialize
Replace ITEM_ID with the item you want removed from the player.Code:if(player.getBank().contains(item id)) player.getBank().removeAll(item id); if(player.getInventory().contains(item id)) player.getInventory().removeAll(item id);
What this code does is check if the player contains the item "ITEM_ID" in his/her inventory or bank and removes it.
If you would like to remove multiple items at once, replace the code above with this:
Replace ITEM_ID1 through ITEM_ID4 with actual Id's. And you can remove some if you don't need or add more if you need.Code:int[] ecoItems = {ITEM_ID1, ITEM_ID2, ITEM_ID3, ITEMID4}; for (int i = 0; i < ecoItems.length; i++) { if(player.getBank().contains(ecoItems[i])) player.getBank().removeAll(ecoItems[i]); if (player.getInventory().contains(ecoItems[i])) player.getInventory().removeAll(ecoItems[i]); }
What this code does is check for all of the id's put into "ecoItems" and if it finds those ids, it removes them from the player.
Enjoy
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |