• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Check backpack uid

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hello
I have a little problem with this function http://otland.net/threads/creatureevent-onmove-very-advanced.134016/ when i move item from 1st backpack by dropping item on 2nd bp the uid of "toItem" and "fromItem" are same (moveing item and 2nd bp are in 1st bp) When i open 2 bp and move from 1st bp window to second window it works normaly. I tried some functions to check uid of this 2nd bp but still it gets the same uid :S Some1 help?
 
Yeah i know my english is poor :S With your function is same problem and i will try to write it more simple :s we have 1st backpack and after open it we have inside located 1 item and 2nd backpack. now we move item to this 2nd bp by dropping on slot in 1st bp(and it automatically move item to 2nd bp) and function return toContainer and fromContainer as 1st bp(it means same like we dont move item to new bp but we did) only after open 1st and 2nd bp in the same time and move item from slot in 1st bp to slot in 2nd bp it return fromContainer as 1st bp and toContainer as 2nd and its good. if still some1 dont understand i can record it :D
 
BUMP and script is
Code:
function onMoveItem(cid, item, fromPosition, toPosition, fromItem, toItem, fromGround, toGround, status)
if item.itemid == 10148 then
if toItem.itemid ~= 9610 then
doPlayerSendCancel(cid, "You can move this item only to special container.")
return false
end
end
return true
end
and it works only after you open this toItem and move there item
 
BUMP still needs some help i tried to change some in c++ like if iscontainer getcontaineritem etc. but dont knows much the c++ functions
 
Bump tried
Code:
if(toCylinder && toCylinder->getItem()->isContainer())
{
toItem = toCylinder->getItem()->getContainer;
}
if(toCylinder)
{
toItem = toCylinder->getItem();
but still dont works need help :<
 
If you use my implementation you can check for toContainer.itemid like you already do.
The other case where you drop the item on the container should also be possible. toPosition.y or toPosition.z should be the container index (you have to check which one it is).
So you can use getContainerItem(toContainer.uid, index).itemid == specialContainerId to check for that
 
Used getContainerItem and it works but i have one more problem how to check container is full or not? Becouse im using same function in another script and i want to run script only when item will move. I tried something with getContainerSize but it count items in container and how to check the container max size?
 
Back
Top