function onSay(cid, words, param, channel)
local items = {
["chipsen"] = {id = 2167, price = 20000},
["rox"] = {id = 2166, price = 20000}
}
local now = items[param]
if (not now) then
doPlayerSendCancel(cid, "Item not found ='(")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end
local count = getPlayerItemCount(cid, now.id)
if (count >= 1) then
doPlayerRemoveItem(cid, now.id, count)
doPlayerAddMoney(cid, count * now.price)
doPlayerSendCancel(cid, "Sold ".. count .."x ".. param .." for ".. count * now.price ." gold.")
doSendAnimatedText(getCreaturePosition(cid), "$$$$", TEXTCOLOR_GREEN)
else
doPlayerSendCancel(cid, "You haven't this item ='(")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end