kimokimo
Kimo
As the title says i was working on something in player.lua in moveitem function and i found no cid in the parameters i tried playing around like this :
but then this local cid = self:getId() return nill
PHP:
local sellableitem = pricetable[item.itemid]
local tile = toPosition:getTile()
local targetTile = {x= 970, y= 992, z= 6}
local uids = item
local bp = self:addItem(uids.itemid, 1)
local cid = self:getId()
if item:getActionId() == 4000 then
self:sendTextMessage(MESSAGE_EVENT_DEFAULT, "You can't steal this item!.")
return false
elseif toPosition.x == targetTile.x and toPosition.y == targetTile.y and toPosition.z == targetTile.z then
if isContainer(item.uid) then
doSellContainer(item, cid, position, true, false)
doAddCopiedContainer(uids, bp)
return doRemoveItem(item.uid)
else
if sellableitem then
doSellItem(item, cid, position, true, true)
else
self:addItem(item.itemid, item.type)
doRemoveItem(item.uid)
self:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your "..getItemNameById(item.itemid).." is not sellable, so it was returned to you.")
end
end
end
return true
end
Last edited: