whitevo
Feeling good, thats what I do.
Another problem, since this onMoveItem fromPosition and toPosition has only 1 useful parameter..
How do I get the container owner where the item was moved out?
If the container is not on player, then it should be nil.
Problem is, i cant even get the container UID in first place.
Problem is that positions only give:
x = container or tile
y = kind of a bag id (but it only registrates the currently opened bags)
z = cylinder id (or in some occasion shows if the moveitem is container i guess)
stackpos = useless...
EDIT:
Alright so for now gona try something like this:
and then i'm gona check if the moved item came from bag.
If it does, then gona check all the player bags and try to find the match, if no match found then it means that was not player container where the item was moved from.
In theory it works, not sure does it actually work too xD
BTW, eve though you might see a mistake in my container making, its not. because in my server you cant put bags into bag. (unless its special type of bag) and into special type of bags you cant put any bags.
EDIT2:
Now the problem is: How do I get the owner of container where I move the object? xD
EDIT3:
Ok i have an idea.
Sending out prove first (item) and then checking did that item reach to player xD
if not then in theory the container has no owner.
edit4:
Grr. can't createItem to container which location i don't know >.>
How do I get the container owner where the item was moved out?
If the container is not on player, then it should be nil.
Problem is, i cant even get the container UID in first place.
Problem is that positions only give:
x = container or tile
y = kind of a bag id (but it only registrates the currently opened bags)
z = cylinder id (or in some occasion shows if the moveitem is container i guess)
stackpos = useless...
EDIT:
Alright so for now gona try something like this:
Code:
local bag = player:getSlotItem(3)
local playerContainers = {}
if bag then
table.insert(playerContainers, bag)
for x=0, bag:getSize()-1 do
if bag:getItem(x) then
if bag:getItem(x):isContainer() then
table.insert(playerContainers, bag:getItem(x))
end
else break
end
end
end
If it does, then gona check all the player bags and try to find the match, if no match found then it means that was not player container where the item was moved from.
In theory it works, not sure does it actually work too xD
BTW, eve though you might see a mistake in my container making, its not. because in my server you cant put bags into bag. (unless its special type of bag) and into special type of bags you cant put any bags.
EDIT2:
Now the problem is: How do I get the owner of container where I move the object? xD
EDIT3:
Ok i have an idea.
Sending out prove first (item) and then checking did that item reach to player xD
if not then in theory the container has no owner.
edit4:
Grr. can't createItem to container which location i don't know >.>
Last edited: