Can you usually pick up off the floor whilst dropping manually (I'm not going to load up the video as I got limited bandwith).
|
Well I was just trying something and I made up a command that drops an item on the floor. When I type the command in, the item appears on the coordinations I want it to be on. But the problem is, I CANT PICK THE ITEM UP.. Does anyone know how to fix this? Heres a video..
http://img441.imageshack.us/img441/9306/6iz.mp4
Can you usually pick up off the floor whilst dropping manually (I'm not going to load up the video as I got limited bandwith).
Yes I am able to pickup drops by NPC's or if I kill a player in the wilderness. But if I drop a item, it will dissappear because I do not want duping happening. BUT if I INTENIONALLY use the command and item drops, I can see it on the floor but I can't pick it up.
I watched the video btw.
Firstly, does it do it with more than 1 item?
Secondly, can you quote the code on your command and your ground item packet (or anything else on ground items).
If you want, I'll add this into a PI server on my hard drive and test it out. See if I can come up with anything for you.
if (playerCommand.startsWith("dpl") && c.playerRights >= 3) {
c.getItems().createGroundItem(14484, 3087, 3489, 1);
}
Won't pick up...?
why do you even need that command? can you not drop items on your server?
Im thinking drop partys?
This removes the itempublic void removeGroundItem(int itemID, int itemX, int itemY, int Amount) {
synchronized(c) {
c.getOutStream().createFrame(85);
c.getOutStream().writeByteC((itemY - 8 * c.mapRegionY));
c.getOutStream().writeByteC((itemX - 8 * c.mapRegionX));
c.getOutStream().createFrame(156);
c.getOutStream().writeByteS(0);
c.getOutStream().writeWord(itemID);
c.flushOutStream();
}
}
public boolean addItem(int item, int amount) {
synchronized(c) {
if (amount < 1) {
amount = 1;
}
if(item <= 0) {
return false;
}
if ((((freeSlots() >= 1) || playerHasItem(item, 1)) && Item.itemStackable[item]) || ((freeSlots() > 0) && !Item.itemStackable[item])) {
for (int i = 0; i < c.playerItems.length; i++) {
if ((c.playerItems[i] == (item + 1)) && Item.itemStackable[item]
&& (c.playerItems[i] > 0)) {
c.playerItems[i] = (item + 1);
if (((c.playerItemsN[i] + amount) < Config.MAXITEM_AMOUNT)
&& ((c.playerItemsN[i] + amount) > -1)) {
c.playerItemsN[i] += amount;
} else {
c.playerItemsN[i] = Config.MAXITEM_AMOUNT;
}
if(c.getOutStream() != null && c != null ) {
c.getOutStream().createFrameVarSizeWord(34);
c.getOutStream().writeWord(3214);
c.getOutStream().writeByte(i);
c.getOutStream().writeWord(c.playerItems[i]);
if (c.playerItemsN[i] > 254) {
c.getOutStream().writeByte(255);
c.getOutStream().writeDWord(c.playerItemsN[i]);
} else {
c.getOutStream().writeByte(c.playerItemsN[i]);
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}
i = 30;
return true;
}
}
for (int i = 0; i < c.playerItems.length; i++) {
if (c.playerItems[i] <= 0) {
c.playerItems[i] = item + 1;
if ((amount < Config.MAXITEM_AMOUNT) && (amount > -1)) {
c.playerItemsN[i] = 1;
if (amount > 1) {
c.getItems().addItem(item, amount - 1);
return true;
}
} else {
c.playerItemsN[i] = Config.MAXITEM_AMOUNT;
}
/*if(c.getOutStream() != null && c != null ) {
c.getOutStream().createFrameVarSizeWord(34);
c.getOutStream().writeWord(3214);
c.getOutStream().writeByte(i);
c.getOutStream().writeWord(c.playerItems[i]);
if (c.playerItemsN[i] > 254) {
c.getOutStream().writeByte(255);
c.getOutStream().writeDWord(c.playerItemsN[i]);
} else {
c.getOutStream().writeByte(c.playerItemsN[i]);
}
c.getOutStream().endFrameVarSizeWord();
c.flushOutStream();
}*/
resetItems(3214);
i = 30;
return true;
}
}
return false;
} else {
resetItems(3214);
c.sendMessage("Not enough space in your inventory.");
return false;
}
}
}
I'll try your's Linus
Linus, it doesn't work and I already had it defined.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |