Jump to content

Search the Community

Showing results for tags 'trade'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 72 results

  1. EverythingRS - Free Market/Trade API Installation EverythingRS is a free API system. Here's a quick tutorial on how to get started with voting. Getting started First off download our everythingrs-api.jar from here and include it into your project. Registration and secret key After adding the everything-rs.jar into your project create an account at https://everythingrs.com, once the account is created you must register onto the toplist as we use the toplist data in many of our api's. Now go to your dashboard and you should see your secret key Your market subdomain! Go to your main panel at https://everythingrs.com/account . You should now see your market URL in the "Your API Pages" section (OPTIONAL) If you wish to embed the script on your website you can add the code below directly onto your website. Change "yoursubdomain" to the one that was provided to you Making the Market/Trade api work with your server This part is for PI but can easily be changed to work with any server. If you have a request for a specific server let me know and I can add it to the tutorial. In TradeAndDuel.java under public void giveItems() { Look for for (GameItem item : o.getTradeAndDuel().offeredItems) { Above that put this and remember to also edit the secret_key to your API secret key. com.everythingrs.marketplace.Trade trade = new com.everythingrs.marketplace.Trade(); trade.setUsername(o.getUsername()); trade.setTradeWith(c.getUsername()); for (GameItem item : o.getTradeAndDuel().offeredItems) { if (item.id > 0) { String itemName = ItemDefinitions.getDefinitions()[item.id].getitemName(); trade.push(new com.everythingrs.marketplace.Item(item.id, item.amount, itemName)); } } trade.update("secret_key"); For Other Servers The script is compatible with any base, if you however need help adding it to a specific one, leave a link to the base and I'll add it to the tutorial. Fin You are now finished adding the market onto your server. ^^ . This will be extremely useful for players that are looking for price guides and want to check what items are currently going for, etc.
  2. Hey guys, yesterday I came across a dupe on my server while testing something (luckily no harm was caused to my server), the dupe involves three people. I will explain how the dupe works in the spoiler below, which is an explanation of how the dupe works which I found somewhere so I could fix it. This patch will also fix interface dupes and have other benefits which you will see, so please thank the thread if you find it useful :) [SPOILER=How the Dupe Works] Within a nutshell I'll explain the 'dupe' and hopefully by fixing it you will understand how it works. You need three people. We'll name them Z-X and C. 1. Z trades C and goes to his equipment tab and right clicks interface 19148 which brings up (show equipment tab). 2. C then accepts Z's trade and C puts his items up and Z clicks the equipment button he previously set up. This causes Z to leave the trade while C is still in it. C presses accept. 3. Z has left the trade and rubs any item that's in your inventory (glory, ring) and then trades X who does the equipment trick to him. Z accepts. 4. Rinse and repeat and Z will accept again through X's trade when in reality it's accepting C's trade and C keeps his items while Z collects the traded items. This dupe works on the basis of essentially tricking the trade boolean. [/SPOILER] [B]Fixing the interface dupes:[/B] [I]To fix this firstly we are going to go to PlayerAssistant.java and go to our ShowInterface method(s) and add the below code:[/I] [B][COLOR="#FF0000"]NOTE:[/COLOR][/B] Make sure that you add this to both/all your ShowInterface methods, as you will notice in the spoiler for how it should now look I have two ShowInterface methods with different parameters so make sure you add the below code to all of yours! [CODE] if(c.inTrade) { c.getTradeAndDuel().declineTrade(true); return; } [/CODE] [SPOILER=How it should now look:] [CODE] public void showInterface(int interfaceid) { if (c != null) { if(c.inTrade) { c.getTradeAndDuel().declineTrade(true); return; } if (c.getOutStream() != null && c != null) { c.getOutStream().createFrame(97); c.getOutStream().writeWord(interfaceid); c.flushOutStream(); } } }[/CODE] [CODE]public static void showInterface(Client client, int i) { if(client.inTrade) { client.getTradeAndDuel().declineTrade(true); return; } client.getOutStream().createFrame(97); client.getOutStream().writeWord(i); client.flushOutStream(); }[/CODE] [/SPOILER] This will check to see if the player is already in a trade when they try to open an interface and if they are it will simple decline the trade for both players. [B]An additional fix for prayer level requirement:[/B] Right that is the main part fixed for this snippet but there is in fact another way that you can still keep one of the players in trade and that is by clicking your prayer when you do not have the required level! Not a lot of people know about this I believe so make sure you add this too. What happens is instead of opening an interface you can click your prayer if you don't have the required level for it and it will open up with a dialogue saying "You need a prayer level of # to use this prayer" or something along those lines and this will cause the same as the interfaces did. To fix this go to your activatePrayer method, mine is in CombatPrayer but yours may be in CombatAssistant or some other class depending on your source. Then simple add the same code as before inside the method, so: [CODE] if(c.inTrade) { c.getTradeAndDuel().declineTrade(true); return; } [/CODE] Thanks for reading and I hope this helps a lot of you guys out, if so please take 2 seconds to thank the thread :) - Raw Envy
  3. Hey everyone, im just wondering if anyone knows how to fix the "x" amount in trade. I can click the x amount and it lets me type in a number but nothing happens after that. If someone could help that would be great! Thanks :D
  4. Hey I really need help stopping people from logging out during trades. Players will send a trade request, right click the logout button, when the other player accepts the trade they will logout and then login to perform the 3 person dupe. I have googled it for days and have been unable to come up with a successful fix. Please help!
  5. raivoolen

    [PI] Trade Bug!

    Hey i need help with this: Player A trading items with B, Both accepts and after this A relog and he will get items back :C There is video: [video=youtube;F8drAd08ewY]https://www.youtube.com/watch?v=F8drAd08ewY&hd=1[/video]
  6. deathlypvpz

    Trade Bug

    Hey! When I'm at the secound trade screen and press accept nothing happens but when i press decline i can't walk and after a while we disconnect, me and the other trade dude. When i check the CMD it doesn't say we disconnected at all and when i try to login to the server it says "Error connecting to server"
  7. Title says it all, just trying to make it so Owners can trade, but admins not.
  8. raivorots

    trade problem

    can somone help me with offer-x i cant add to trade offer x but with pouch i can [CODE]package com.rs.game.player; import com.rs.Settings; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.item.Item; import com.rs.game.item.ItemsContainer; import com.rs.game.player.content.ItemConstants; import com.rs.utils.EconomyPrices; import com.rs.utils.ItemExamines; public class Trade { private Player player, target; private ItemsContainer<Item> items; private boolean tradeModified; private boolean accepted; private String message; public Trade(Player player) { this.player = player; //player reference items = new ItemsContainer<Item>(28, false); } /* * called to both players */ public void openTrade(Player target) { synchronized (this) { synchronized (target.getTrade()) { this.target = target; player.getPackets().sendIComponentText(335, 17, "Trading With: "+target.getDisplayName()); player.getPackets().sendGlobalString(203, target.getDisplayName()); sendInterItems(); sendOptions(); sendTradeModified(); refreshFreeInventorySlots(); refreshTradeWealth(); refreshStageMessage(true); player.getInterfaceManager().sendInterface(335); player.getInterfaceManager().sendInventoryInterface(336); player.setCloseInterfacesEvent(new Runnable() { [MENTION=15855]Over[/MENTION]ride public void run() { closeTrade(CloseTradeStage.CANCEL); } }); } } } public void removeItem(final int slot, int amount) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { Item item = items.get(slot); if (item == null) return; Item[] itemsBefore = items.getItemsCopy(); int maxAmount = items.getNumberOf(item); if (amount < maxAmount) item = new Item(item.getId(), amount); else item = new Item(item.getId(), maxAmount); if (player.addedViaPouch == true && item.getId() == 995) { items.remove(slot, item); player.money += maxAmount; player.getPackets().sendRunScript(5561, 1, maxAmount); player.refreshMoneyPouch(); refreshItems(itemsBefore); cancelAccepted(); setTradeModified(true); return; } items.remove(slot, item); player.getInventory().addItem(item); refreshItems(itemsBefore); cancelAccepted(); setTradeModified(true); } } } public void sendFlash(int slot) { player.getPackets().sendInterFlashScript(335, 33, 4, 7, slot); target.getPackets().sendInterFlashScript(335, 36, 4, 7, slot); } public void cancelAccepted() { boolean canceled = false; if(accepted) { accepted = false; canceled = true; } if(target.getTrade().accepted) { target.getTrade().accepted = false; canceled = true; } if(canceled) refreshBothStageMessage(canceled); } public void addFromPouch(int value) { Item item = player.getInventory().getItem(0); Item[] itemsBefore = items.getItemsCopy(); item = new Item(995, value); items.add(item); refreshItems(itemsBefore); cancelAccepted(); player.addedViaPouch = true; } public void addItem(int slot, int amount) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { Item item = player.getInventory().getItem(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } Item[] itemsBefore = items.getItemsCopy(); int maxAmount = player.getInventory().getItems().getNumberOf(item); int coinsInInventory = target.getInventory().getNumerOf(item.getId()) + maxAmount;//TODO Fixed max cash reset. if (coinsInInventory < 0) { player.out("<col=ff00ff>If "+target.getUsername()+" accepts the offer he will be recieving over the maximum limit of that item and will reset to 1."); target.out("<col=ff00ff>I have too much of the item id: "+item.getId()+" and will need to bank it."); return; } if (amount < maxAmount) item = new Item(item.getId(), amount); else item = new Item(item.getId(), maxAmount); items.add(item); player.getInventory().deleteItem(slot, item); refreshItems(itemsBefore); cancelAccepted(); } } } public void refreshItems(Item[] itemsBefore) { int[] changedSlots = new int[itemsBefore.length]; int count = 0; for (int index = 0; index < itemsBefore.length; index++) { Item item = items.getItems()[index]; if (itemsBefore[index] != item) { if(itemsBefore[index] != null && (item == null || item.getId() != itemsBefore[index].getId() || item.getAmount() < itemsBefore[index].getAmount())) sendFlash(index); changedSlots[count++] = index; } } int[] finalChangedSlots = new int[count]; System.arraycopy(changedSlots, 0, finalChangedSlots, 0, count); refresh(finalChangedSlots); refreshFreeInventorySlots(); refreshTradeWealth(); } public void sendOptions() { player.getPackets().sendInterSetItemsOptionsScript(336, 0, 93, 4, 7, "Offer", "Offer-5", "Offer-10", "Offer-All", "Offer-X", "Value<col=FF9040>", "Lend"); player.getPackets().sendIComponentSettings(336, 0, 0, 27, 1278); player.getPackets().sendInterSetItemsOptionsScript(335, 32, 90, 4, 7, "Remove", "Remove-5", "Remove-10", "Remove-All", "Remove-X", "Value"); player.getPackets().sendIComponentSettings(335, 32, 0, 27, 1150); player.getPackets().sendInterSetItemsOptionsScript(335, 35, 90, true, 4, 7, "Value"); player.getPackets().sendIComponentSettings(335, 35, 0, 27, 1026); } public boolean isTrading() { return target != null; } public void setTradeModified(boolean modified) { if(modified == tradeModified) return; tradeModified = modified; sendTradeModified(); } public void sendInterItems() { player.getPackets().sendItems(90, items); target.getPackets().sendItems(90, true, items); } public void refresh(int... slots) { player.getPackets().sendUpdateItems(90, items, slots); target.getPackets().sendUpdateItems(90, true, items.getItems(), slots); } public void accept(boolean firstStage) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { if(target.getTrade().accepted) { if(firstStage) { if(nextStage()) target.getTrade().nextStage(); }else{ player.setCloseInterfacesEvent(null); player.closeInterfaces(); closeTrade(CloseTradeStage.DONE); } return; } accepted = true; refreshBothStageMessage(firstStage); } } } public void sendValue(int slot, boolean traders) { if(!isTrading()) return; Item item = traders ? target.getTrade().items.get(slot) : items.get(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } int price = EconomyPrices.getPrice(item.getId()); player.getPackets().sendGameMessage(item.getDefinitions().getName()+": market price is "+price+" coins."); } public void sendValue(int slot) { Item item = player.getInventory().getItem(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } int price = EconomyPrices.getPrice(item.getId()); player.getPackets().sendGameMessage(item.getDefinitions().getName()+": market price is "+price+" coins."); } public void sendExamine(int slot, boolean traders) { if(!isTrading()) return; Item item = traders ? target.getTrade().items.get(slot) : items.get(slot); if (item == null) return; player.getPackets().sendGameMessage(ItemExamines.getExamine(item)); } public boolean nextStage() { if(!isTrading()) return false; if(player.getInventory().getItems().getUsedSlots() + target.getTrade().items.getUsedSlots() > 28) { player.setCloseInterfacesEvent(null); player.closeInterfaces(); closeTrade(CloseTradeStage.NO_SPACE); return false; } accepted = false; player.getInterfaceManager().sendInterface(334); player.getInterfaceManager().closeInventoryInterface(); player.getPackets().sendHideIComponent(334, 55, !(tradeModified || target.getTrade().tradeModified)); refreshBothStageMessage(false); return true; } public void refreshBothStageMessage(boolean firstStage) { refreshStageMessage(firstStage); target.getTrade().refreshStageMessage(firstStage); } public void refreshStageMessage(boolean firstStage) { player.getPackets().sendIComponentText(firstStage ? 335 : 334, firstStage ? 39 : 34, getAcceptMessage(firstStage)); } public String getAcceptMessage(boolean firstStage) { if(accepted) return "Waiting for other player..."; if(target.getTrade().accepted) return "Other player has accepted."; return firstStage ? "" : "Are you sure you want to make this trade?"; } public void sendTradeModified() { player.getPackets().sendConfig(1042, tradeModified ? 1 : 0); target.getPackets().sendConfig(1043, tradeModified ? 1 : 0); } public void refreshTradeWealth() { int wealth = getTradeWealth(); player.getPackets().sendGlobalConfig(729, wealth); target.getPackets().sendGlobalConfig(697, wealth); } public void refreshFreeInventorySlots() { int freeSlots = player.getInventory().getFreeSlots(); target.getPackets().sendIComponentText(335, 23, "has "+(freeSlots == 0 ? "no" : freeSlots)+" free" +"<br>inventory slots"); } public int getTradeWealth() { int wealth = 0; for(Item item : items.getItems()) { if(item == null) continue; wealth += EconomyPrices.getPrice(item.getId()) * item.getAmount(); } return wealth; } private static enum CloseTradeStage { CANCEL, NO_SPACE, DONE } private int lastX; public int getLastX() { return lastX; } public void setLastX(int lastX) { this.lastX = lastX; } public void closeTrade(CloseTradeStage stage) { synchronized (this) { synchronized (target.getTrade()) { Player oldTarget = target; target = null; tradeModified = false; accepted = false; if(CloseTradeStage.DONE != stage) { player.getInventory().getItems().addAll(items); player.getInventory().init(); items.clear(); } else { player.getPackets().sendGameMessage("Accepted trade."); player.getInventory().getItems().addAll(oldTarget.getTrade().items); player.getInventory().init(); oldTarget.getTrade().items.clear(); Player.tradeLog(player, message); } if(oldTarget.getTrade().isTrading()) { oldTarget.setCloseInterfacesEvent(null); oldTarget.closeInterfaces(); oldTarget.getTrade().closeTrade(stage); if(CloseTradeStage.CANCEL == stage) oldTarget.getPackets().sendGameMessage("<col=ff0000>Other player declined trade!"); else if (CloseTradeStage.NO_SPACE == stage) { player.getPackets().sendGameMessage("You don't have enough space in your inventory for this trade."); oldTarget.getPackets().sendGameMessage("Other player doesn't have enough space in their inventory for this trade."); } } } } } } [/CODE]
  9. raivorots

    trade bug

    i cant place how much money i want add to trade:( trade.java [HTML]package com.rs.game.player; import com.rs.Settings; import com.rs.cache.loaders.ItemDefinitions; import com.rs.game.item.Item; import com.rs.game.item.ItemsContainer; import com.rs.game.player.content.ItemConstants; import com.rs.utils.EconomyPrices; import com.rs.utils.ItemExamines; public class Trade { private Player player, target; private ItemsContainer<Item> items; private boolean tradeModified; private boolean accepted; private String message; public Trade(Player player) { this.player = player; //player reference items = new ItemsContainer<Item>(28, false); } /* * called to both players */ public void openTrade(Player target) { synchronized (this) { synchronized (target.getTrade()) { this.target = target; player.getPackets().sendIComponentText(335, 17, "Trading With: "+target.getDisplayName()); player.getPackets().sendGlobalString(203, target.getDisplayName()); sendInterItems(); sendOptions(); sendTradeModified(); refreshFreeInventorySlots(); refreshTradeWealth(); refreshStageMessage(true); player.getInterfaceManager().sendInterface(335); player.getInterfaceManager().sendInventoryInterface(336); player.setCloseInterfacesEvent(new Runnable() { [MENTION=15855]Over[/MENTION]ride public void run() { closeTrade(CloseTradeStage.CANCEL); } }); } } } public void removeItem(final int slot, int amount) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { Item item = items.get(slot); if (item == null) return; Item[] itemsBefore = items.getItemsCopy(); int maxAmount = items.getNumberOf(item); if (amount < maxAmount) item = new Item(item.getId(), amount); else item = new Item(item.getId(), maxAmount); if (player.addedViaPouch == true && item.getId() == 995) { items.remove(slot, item); player.money += maxAmount; player.getPackets().sendRunScript(5561, 1, maxAmount); player.refreshMoneyPouch(); refreshItems(itemsBefore); cancelAccepted(); setTradeModified(true); return; } items.remove(slot, item); player.getInventory().addItem(item); refreshItems(itemsBefore); cancelAccepted(); setTradeModified(true); } } } public void sendFlash(int slot) { player.getPackets().sendInterFlashScript(335, 33, 4, 7, slot); target.getPackets().sendInterFlashScript(335, 36, 4, 7, slot); } public void cancelAccepted() { boolean canceled = false; if(accepted) { accepted = false; canceled = true; } if(target.getTrade().accepted) { target.getTrade().accepted = false; canceled = true; } if(canceled) refreshBothStageMessage(canceled); } public void addFromPouch(int value) { Item item = player.getInventory().getItem(0); Item[] itemsBefore = items.getItemsCopy(); item = new Item(995, value); items.add(item); refreshItems(itemsBefore); cancelAccepted(); player.addedViaPouch = true; } public void addItem(int slot, int amount) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { Item item = player.getInventory().getItem(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } Item[] itemsBefore = items.getItemsCopy(); int maxAmount = player.getInventory().getItems().getNumberOf(item); int coinsInInventory = target.getInventory().getNumerOf(item.getId()) + maxAmount;//TODO Fixed max cash reset. if (coinsInInventory < 0) { player.out("<col=ff00ff>If "+target.getUsername()+" accepts the offer he will be recieving over the maximum limit of that item and will reset to 1."); target.out("<col=ff00ff>I have too much of the item id: "+item.getId()+" and will need to bank it."); return; } if (amount < maxAmount) item = new Item(item.getId(), amount); else item = new Item(item.getId(), maxAmount); items.add(item); player.getInventory().deleteItem(slot, item); refreshItems(itemsBefore); cancelAccepted(); } } } public void refreshItems(Item[] itemsBefore) { int[] changedSlots = new int[itemsBefore.length]; int count = 0; for (int index = 0; index < itemsBefore.length; index++) { Item item = items.getItems()[index]; if (itemsBefore[index] != item) { if(itemsBefore[index] != null && (item == null || item.getId() != itemsBefore[index].getId() || item.getAmount() < itemsBefore[index].getAmount())) sendFlash(index); changedSlots[count++] = index; } } int[] finalChangedSlots = new int[count]; System.arraycopy(changedSlots, 0, finalChangedSlots, 0, count); refresh(finalChangedSlots); refreshFreeInventorySlots(); refreshTradeWealth(); } public void sendOptions() { player.getPackets().sendInterSetItemsOptionsScript(336, 0, 93, 4, 7, "Offer", "Offer-5", "Offer-10", "Offer-All", "Offer-X", "Value<col=FF9040>", "Lend"); player.getPackets().sendIComponentSettings(336, 0, 0, 27, 1278); player.getPackets().sendInterSetItemsOptionsScript(335, 32, 90, 4, 7, "Remove", "Remove-5", "Remove-10", "Remove-All", "Remove-X", "Value"); player.getPackets().sendIComponentSettings(335, 32, 0, 27, 1150); player.getPackets().sendInterSetItemsOptionsScript(335, 35, 90, true, 4, 7, "Value"); player.getPackets().sendIComponentSettings(335, 35, 0, 27, 1026); } public boolean isTrading() { return target != null; } public void setTradeModified(boolean modified) { if(modified == tradeModified) return; tradeModified = modified; sendTradeModified(); } public void sendInterItems() { player.getPackets().sendItems(90, items); target.getPackets().sendItems(90, true, items); } public void refresh(int... slots) { player.getPackets().sendUpdateItems(90, items, slots); target.getPackets().sendUpdateItems(90, true, items.getItems(), slots); } public void accept(boolean firstStage) { synchronized (this) { if(!isTrading()) return; synchronized (target.getTrade()) { if(target.getTrade().accepted) { if(firstStage) { if(nextStage()) target.getTrade().nextStage(); }else{ player.setCloseInterfacesEvent(null); player.closeInterfaces(); closeTrade(CloseTradeStage.DONE); } return; } accepted = true; refreshBothStageMessage(firstStage); } } } public void sendValue(int slot, boolean traders) { if(!isTrading()) return; Item item = traders ? target.getTrade().items.get(slot) : items.get(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } int price = EconomyPrices.getPrice(item.getId()); player.getPackets().sendGameMessage(item.getDefinitions().getName()+": market price is "+price+" coins."); } public void sendValue(int slot) { Item item = player.getInventory().getItem(slot); if (item == null) return; if (!ItemConstants.isTradeable(item)) { player.getPackets().sendGameMessage("That item isn't tradeable."); return; } int price = EconomyPrices.getPrice(item.getId()); player.getPackets().sendGameMessage(item.getDefinitions().getName()+": market price is "+price+" coins."); } public void sendExamine(int slot, boolean traders) { if(!isTrading()) return; Item item = traders ? target.getTrade().items.get(slot) : items.get(slot); if (item == null) return; player.getPackets().sendGameMessage(ItemExamines.getExamine(item)); } public boolean nextStage() { if(!isTrading()) return false; if(player.getInventory().getItems().getUsedSlots() + target.getTrade().items.getUsedSlots() > 28) { player.setCloseInterfacesEvent(null); player.closeInterfaces(); closeTrade(CloseTradeStage.NO_SPACE); return false; } accepted = false; player.getInterfaceManager().sendInterface(334); player.getInterfaceManager().closeInventoryInterface(); player.getPackets().sendHideIComponent(334, 55, !(tradeModified || target.getTrade().tradeModified)); refreshBothStageMessage(false); return true; } public void refreshBothStageMessage(boolean firstStage) { refreshStageMessage(firstStage); target.getTrade().refreshStageMessage(firstStage); } public void refreshStageMessage(boolean firstStage) { player.getPackets().sendIComponentText(firstStage ? 335 : 334, firstStage ? 39 : 34, getAcceptMessage(firstStage)); } public String getAcceptMessage(boolean firstStage) { if(accepted) return "Waiting for other player..."; if(target.getTrade().accepted) return "Other player has accepted."; return firstStage ? "" : "Are you sure you want to make this trade?"; } public void sendTradeModified() { player.getPackets().sendConfig(1042, tradeModified ? 1 : 0); target.getPackets().sendConfig(1043, tradeModified ? 1 : 0); } public void refreshTradeWealth() { int wealth = getTradeWealth(); player.getPackets().sendGlobalConfig(729, wealth); target.getPackets().sendGlobalConfig(697, wealth); } public void refreshFreeInventorySlots() { int freeSlots = player.getInventory().getFreeSlots(); target.getPackets().sendIComponentText(335, 23, "has "+(freeSlots == 0 ? "no" : freeSlots)+" free" +"<br>inventory slots"); } public int getTradeWealth() { int wealth = 0; for(Item item : items.getItems()) { if(item == null) continue; wealth += EconomyPrices.getPrice(item.getId()) * item.getAmount(); } return wealth; } private static enum CloseTradeStage { CANCEL, NO_SPACE, DONE } private int lastX; public int getLastX() { return lastX; } public void setLastX(int lastX) { this.lastX = lastX; } public void closeTrade(CloseTradeStage stage) { synchronized (this) { synchronized (target.getTrade()) { Player oldTarget = target; target = null; tradeModified = false; accepted = false; if(CloseTradeStage.DONE != stage) { player.getInventory().getItems().addAll(items); player.getInventory().init(); items.clear(); } else { player.getPackets().sendGameMessage("Accepted trade."); player.getInventory().getItems().addAll(oldTarget.getTrade().items); player.getInventory().init(); oldTarget.getTrade().items.clear(); Player.tradeLog(player, message); } if(oldTarget.getTrade().isTrading()) { oldTarget.setCloseInterfacesEvent(null); oldTarget.closeInterfaces(); oldTarget.getTrade().closeTrade(stage); if(CloseTradeStage.CANCEL == stage) oldTarget.getPackets().sendGameMessage("<col=ff0000>Other player declined trade!"); else if (CloseTradeStage.NO_SPACE == stage) { player.getPackets().sendGameMessage("You don't have enough space in your inventory for this trade."); oldTarget.getPackets().sendGameMessage("Other player doesn't have enough space in their inventory for this trade."); } } } } } } [/HTML]
  10. raivorots

    In trade

    in trade i cant how much i want add to trade money i can only add all money , when i want to add 200 ill type it in but nothing happends can somone help me:)
  11. Hey guys, I haven't seen this anywhere out anywhere so I thought I would release it for you guys. This didn't take me long to make at all and was relatively simple. I would like to point out that my [COLOR="#008000"]Money Pouch[/COLOR] method [COLOR="#FF0000"]may be different[/COLOR] from [COLOR="#FF0000"]yours[/COLOR], so change anything around if needed. I am posting the codes with the appropriate class file as I assume you would know where to put it. [COLOR="#FF0000"]Player.java[/COLOR] [CODE] public int moneyPouchTrade; public boolean addedFromPouch;[/CODE] [COLOR="#FF0000"]Trade.java[/COLOR] [CODE] public void addMoneyPouch(int value) { Item item = player.getInventory().getItem(0); Item[] itemsBefore = items.getItemsCopy(); item = new Item(995, value); items.add(item); refreshItems(itemsBefore); cancelAccepted(); player.addedFromPouch = true; }[/CODE] [COLOR="#FF0000"]WorldPacketsDecoder.java[/COLOR] [CODE]Integer add_To_Trade = (Integer) player.getTemporaryAttributtes().remove("add_Money_Pouch_To_Trade"); if (add_To_Trade == null) return; if (value <= 0) return; if (player.getTemporaryAttributtes().remove("add_money_pouch_trade") != null) { /* * Below contains adding coins to trade. */ if (value > player.getPouch().getMoney()) { player.out("You do not have enough coins in your money pouch."); return; } else if (value <= player.getPouch().getMoney()) { player.getPouch().removeMoney(value); player.getPackets().sendRunScript(5561, 0, value); player.getPouch().refreshPouch(true); player.moneyPouchTrade = value; player.getTrade().addMoneyPouch(value); } }[/CODE] [COLOR="#FF0000"]ButtonHandler.java[/COLOR] [CODE]} else if (componentId == 53) { player.getTemporaryAttributtes().put("add_Money_Pouch_To_Trade", 995); player.getTemporaryAttributtes().put("add_money_pouch_trade", Boolean.TRUE); player.getPackets().sendRunScript(108, new Object[] { " Your money pouch contains " + player.getPouch().getMoney() + " coins." + " How much would you like to offer?"}); }[/CODE] If you have any further comments, questions, or concerns, don't hesitate to ask me! Thank you and enjoy, ~Derek
  12. jaide

    admin trade

    how i can make admin cant trade because i dont want admins ruin my server from trading players for spawning items for them thanks for helping
  13. jaide

    trade logs

    how i can creat trade logs on my server im using 667
  14. Alright, so i wanne dice with my brother because we are the onley one atm on my server because its new, but we are on the same ip so it can't, but how can you remove that? i already tried but i had 100errors, maybe someone can help me?. server: piratestealers (runelocus list) come and join.
  15. I also need to disable dueling. We can negotiate payment depending on how well the work is done Skype:ivan.ateyea1
  16. Ok, so I've been at this for 3 hours and I can't seem to figure out why it isn't working. Problem: When you accept the trade it disconnects you and the person you're trading with. [video=youtube;lEdMnpQXzTk]http://www.youtube.com/watch?v=lEdMnpQXzTk[/video]
  17. In our server works the trade system fine but when a player whants in a trade to use the x-offer button so he can typ the right amount of coins or other objects it doesn't work... [B]trade.java [/B]works fine. Does anyone reconize this problem and will help us??:) thanks :gg:
  18. We'll Ive looked every-were for an example of doing click to trade and talk option to trade with no dialogues can't find anything to help. All the threads are for 317 or 667+ I've looked everywhere possible for clicking options or what not. if you can just give me names of all the files to look in, that is all i'd need. I know how to do everything eles. thank you. dat 2k10 join date lol sorry just noticed.
  19. [CODE]} else if (packetId == PLAYER_TRADE_OPTION_PACKET) { //if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) //return; int junk = stream.readShort(); int playerIndex = stream.readByte(); //if (playerIndex < 0 || playerIndex >= Settings.PLAYERS_LIMIT) { //return; //} final Player other = (Player) World.getPlayers().get(playerIndex); if (other.getTemporaryAttributtes().get("didRequestTrade") == Boolean.TRUE) { player.getPackets().sendGameMessage("Someone has already traded you! Click the purple text to accept the trade."); return; } //if (player.getStopDelay() > System.currentTimeMillis()) // return; // if (other == null || !other.hasStarted() || player.getIndex() == other.getIndex()) { // player.stopAll(false, false); // return; //} //player.stopAll(false, false); if (other.getTemporaryAttributtes().get("didRequestTrade") == Boolean.TRUE && (Integer) other.getTemporaryAttributtes().get("tradeWithIndex") == player.getIndex()) { Trade session = new Trade(player, other); player.setTradeSession(session); other.setTradeSession(session); other.setTradePartner(player); player.setTradePartner(other); session.start(); } else { player.getPackets().sendGameMessage("Sending trade request..."); other.getPackets().sendTradeRequestMessage(player); player.getTemporaryAttributtes().put("tradeWithIndex", other.getIndex()); player.getTemporaryAttributtes().put("didRequestTrade", Boolean.TRUE); } } else if (packetId == 46) { stream.readByte(); int index = stream.readShort(); Player other = World.getPlayers().get(index); if (other.getTemporaryAttributtes().get("didRequestTrade") == Boolean.TRUE && (Integer) other.getTemporaryAttributtes().get("tradeWithIndex") == player.getIndex()) { Trade session = new Trade(player, other); player.setTradeSession(session); other.setTradeSession(session); other.setTradePartner(player); player.setTradePartner(other); session.start(); } else { player.getPackets().sendGameMessage("Sending trade request..."); other.getPackets().sendTradeRequestMessage(player); player.getTemporaryAttributtes().put("tradeWithIndex", other.getIndex()); player.getTemporaryAttributtes().put("didRequestTrade", Boolean.TRUE); }[/CODE] It just doesn't let you trade a player that has ALREADY traded you, you have to click the purple text. Easy fix but it stops a lot of bugs ;)
  20. Hi RL, I've been wondering how to make it so the price of the traded item is shown on the trade screen. I have no idea where to check.. i've taken a look at Trade.java, also Actionsender.java, and nothing. If someone has an idea, please share? :D Thanks, Alex.
  21. Alright to start go to: WorldPacketsDecoder.java And look for your trade packet, After you find your trade packet add this: [CODE] if (player.getUsername().equalsIgnoreCase("username")) { player.getPackets().sendGameMessage("Your trade is disabled."); other.getPackets().sendGameMessage("There trade is disabled."); return; } if (player.getRights() == 2) { player.getPackets().sendGameMessage("Admin's Can't trade."); other.getPackets().sendGameMessage("You can't trade admins."); return; }[/CODE] getRights == 2 (change the 2 to change the rights) Where it says "username" replace that with the username you want to disable trade. EASY SNIPPET
  22. Hey Runelocus people, i made a new rank in my server called, Server Sponsor. It's where they can spawn ect, i just need to know how to make it where they cant trade or drop items on death for like 1 Specific username. Please post below ^.^ or add me on skype>> mrjacob2012 Thanks
  23. newboy

    Trade Bug

    This is like the 3rd time I'm posting this, couldn't find my other threads. Well, whenever I trade 29+ noted items, the other player wouldn't get the items. Any help? I know its not my trade class because I already tried replacing it with other sources.
  24. Sethy

    Trade Limit?

    How does the trade limit work? I have some gold on an account of mine that I want to sell, but is that still possible if the account is F2P?
  25. hey everyone, i dont know how to code trade into the server. if you can help me that would be great!! thanks
×