Shiko Erye
LUA - Scripter
- Joined
- Dec 7, 2010
- Messages
- 106
- Reaction score
- 12
LUA:
function doAddBall(cid)
local box = getPlayerSlotItem(cid, 5).uid
doAddContainerItem(box, 2220)
end
function doAddBall(cid)
local box = getPlayerSlotItem(cid, 5).uid
doAddContainerItem(box, 2220)
end
config =
{
slotId = CONST_SLOT_RIGHT,
itemId = 2220,
count = 1
}
function doPlayerAddBall(cid)
local slot = getPlayerSlotItem(cid, config.slotId)
if (slot.uid > 0) then
return doAddContainerItem(slot.uid, config.itemId, config.count)
end
return false
end
Any errors? And do you have container in this slot?@Ralcoral: don't work
<item id="1988" article="a" name="Box">
<attribute key="weight" value="0" />
<attribute key="containerSize" value="12" />
<attribute key="slotType" value="backpack" />
</item>
config =
{
slotId = CONST_SLOT_RIGHT,
itemId = 2220,
count = 1
}
function doPlayerAddBall(cid)
local slot = getPlayerSlotItem(cid, config.slotId)
if (slot.uid > 0) then
print(slot.uid, slot.itemid, getContainerSize(stot.uid))
return doAddContainerItem(slot.uid, config.itemId, config.count)
end
return false
end