The better way would be to find the thing that stops them from trading. Because there is most likely something in the trading methods that stops it.
|
Well on my server, if you trade items with another player and accept and everything after the trade you can't move. So you log out and in so you can move and you now have both items.
Does anyone know a method that makes them able to walk after trade? Because I can put a log out timer after trade.
Code:public boolean tradeItem(int itemID, int fromSlot, int amount) { if (System.currentTimeMillis() - lastButton > 400) { lastButton = System.currentTimeMillis(); } else { return false; } if (!Item.itemStackable[itemID] && (amount > 1)) { for (int a = 1; a <= amount; a++) { int slot = findItem(itemID, playerItems, playerItemsN); if (slot >= 0) { tradeItem(itemID, slot, 1); } } } for (int element : noTrade) { if ((itemID == element) || (itemID == element + 1)) { sendMessage("You can't trade that item"); return false; } } client other = getClient(trade_reqId); //if (!inTrade || !validClient(trade_reqId) || !canOffer) { //declineTrade(); //return false; //} //if (!playerHasItem(itemID, amount)) { //// return false; //} //if (itemID != playerItems[fromSlot] - 1){ // return false; //} if (Item.itemStackable[itemID] || Item.itemIsNote[itemID]) { boolean inTrade = false; for (GameItem item : offeredItems) { if (item.id == itemID) { inTrade = true; item.amount += amount; break; } } if (!inTrade) { offeredItems.add(new GameItem(itemID, amount)); } } else { offeredItems.add(new GameItem(itemID, 1)); } deleteItem(itemID, fromSlot, amount); resetItems(3322); resetTItems(3415); other.resetOTItems(3416); sendFrame126("", 3431); other.sendFrame126("", 3431); return true; }Code:public void tradeReq(int id) { if (!server.trading) { sendMessage("Trading has been disabled, use ::pickup [itemID] [Amount]."); return; } client other = (client) handler.players[id]; if (validClient(trade_reqId)) { if (other.inTrade) { sendMessage("Other player is busy at the moment."); trade_reqId = 0; return; } } if (validClient(trade_reqId) && !inTrade && other.tradeRequested && (other.trade_reqId == playerId)) { openTrade(); other.openTrade(); int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); } else if (validClient(trade_reqId) && !inTrade && (System.currentTimeMillis() - lastButton > 1000)) { lastButton = System.currentTimeMillis(); tradeRequested = true; trade_reqId = id; int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); sendMessage("Sending trade request..."); other.sendMessage(playerName + ":tradereq:"); } }Code:public void confirmScreen() { secondTradeWindow = true; canOffer = false; sendFrame248(3443, 3213); // trade confirm + normal bag resetItems(3214); String SendTrade = "Absolutely nothing!"; String SendAmount = ""; int Count = 0; client other = getClient(trade_reqId); for (GameItem item : offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000000)) { SendAmount = "@cya@" + (item.amount / 1000) + "K @whi@(" + misc.format(item.amount) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 1000000) + " million @whi@(" + misc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amount); } if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemName(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmount; } Count++; } } sendFrame126(SendTrade, 3557); SendTrade = "Absolutely nothing!"; SendAmount = ""; Count = 0; for (GameItem item : other.offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000000)) { SendAmount = "@cya@" + (item.amount / 1000) + "K @whi@(" + misc.format(item.amount) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 1000000) + " million @whi@(" + misc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amount); } if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemName(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmount; } Count++; } } sendFrame126(SendTrade, 3558); }
The better way would be to find the thing that stops them from trading. Because there is most likely something in the trading methods that stops it.
Ill post the methods.
Code:public boolean tradeItem(int itemID, int fromSlot, int amount) { if (System.currentTimeMillis() - lastButton > 400) { lastButton = System.currentTimeMillis(); } else { return false; } if (!Item.itemStackable[itemID] && (amount > 1)) { for (int a = 1; a <= amount; a++) { int slot = findItem(itemID, playerItems, playerItemsN); if (slot >= 0) { tradeItem(itemID, slot, 1); } } } for (int element : noTrade) { if ((itemID == element) || (itemID == element + 1)) { sendMessage("You can't trade that item"); return false; } } client other = getClient(trade_reqId); //if (!inTrade || !validClient(trade_reqId) || !canOffer) { //declineTrade(); //return false; //} //if (!playerHasItem(itemID, amount)) { //// return false; //} //if (itemID != playerItems[fromSlot] - 1){ // return false; //} if (Item.itemStackable[itemID] || Item.itemIsNote[itemID]) { boolean inTrade = false; for (GameItem item : offeredItems) { if (item.id == itemID) { inTrade = true; item.amount += amount; break; } } if (!inTrade) { offeredItems.add(new GameItem(itemID, amount)); } } else { offeredItems.add(new GameItem(itemID, 1)); } deleteItem(itemID, fromSlot, amount); resetItems(3322); resetTItems(3415); other.resetOTItems(3416); sendFrame126("", 3431); other.sendFrame126("", 3431); return true; }Code:public void tradeReq(int id) { if (!server.trading) { sendMessage("Trading has been disabled, use ::pickup [itemID] [Amount]."); return; } client other = (client) handler.players[id]; if (validClient(trade_reqId)) { if (other.inTrade) { sendMessage("Other player is busy at the moment."); trade_reqId = 0; return; } } if (validClient(trade_reqId) && !inTrade && other.tradeRequested && (other.trade_reqId == playerId)) { openTrade(); other.openTrade(); int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); } else if (validClient(trade_reqId) && !inTrade && (System.currentTimeMillis() - lastButton > 1000)) { lastButton = System.currentTimeMillis(); tradeRequested = true; trade_reqId = id; int EnemyX = PlayerHandler.players[trade_reqId].absX; int EnemyY = PlayerHandler.players[trade_reqId].absY; TurnPlayerTo(EnemyX, EnemyY); sendMessage("Sending trade request..."); other.sendMessage(playerName + ":tradereq:"); } }Code:public void confirmScreen() { secondTradeWindow = true; canOffer = false; sendFrame248(3443, 3213); // trade confirm + normal bag resetItems(3214); String SendTrade = "Absolutely nothing!"; String SendAmount = ""; int Count = 0; client other = getClient(trade_reqId); for (GameItem item : offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000000)) { SendAmount = "@cya@" + (item.amount / 1000) + "K @whi@(" + misc.format(item.amount) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 1000000) + " million @whi@(" + misc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amount); } if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemName(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmount; } Count++; } } sendFrame126(SendTrade, 3557); SendTrade = "Absolutely nothing!"; SendAmount = ""; Count = 0; for (GameItem item : other.offeredItems) { if (item.id > 0) { if ((item.amount >= 1000) && (item.amount < 1000000)) { SendAmount = "@cya@" + (item.amount / 1000) + "K @whi@(" + misc.format(item.amount) + ")"; } else if (item.amount >= 1000000) { SendAmount = "@gre@" + (item.amount / 1000000) + " million @whi@(" + misc.format(item.amount) + ")"; } else { SendAmount = "" + misc.format(item.amount); } if (Count == 0) { SendTrade = getItemName(item.id); } else { SendTrade = SendTrade + "\\n" + getItemName(item.id); } if (item.stackable) { SendTrade = SendTrade + " x " + SendAmount; } Count++; } } sendFrame126(SendTrade, 3558); }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |