local item, count, storage = {}, 0, 0
function onUse(cid, item, frompos, itemEx, topos)
item = {
[1] = { id = 2537, price = 4800 },
[2] = { id = 2377, price = 480 },
[3] = { id = 2663, price = 600 },
[4] = { id = 2472, price = 90000 },
}
storage = 556655123
if getPlayerStorageValue(cid, storage) <= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,
"You want to sell multiple items. Be careful, because the equipment you are using can be sold too, keep them.")
addEvent(function()
if isPlayer(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,
"Use this item again to sell the items. REMEMBER TO STORE THE EQUIPMENT YOU ARE USING!")
end
end, 1500)
setPlayerStorageValue(cid, storage, 1)
else
for i = 1, #item, 1 do
count = getPlayerItemCount(cid, item[i].id)
if count > 0 then
doPlayerRemoveItem(cid, item[i].id, count)
doPlayerAddMoney(cid, item[i].price * count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,
"Sold " .. count .. "x " .. getItemNameById(item[i].id) .. " for " .. item[i].price .. " gold.")
end
end
setPlayerStorageValue(cid, storage, 0)
end
return true
end