function onSay(cid, words, param)
local c = {
cost = 10,
required_item = 9020,
requited_count = 1,
item = 2198,
item_count = 1,
}
if getPlayerItemCount(cid, c.required_item) >= c.requited_count then
if getPlayerMoney(cid) > c.cost then
doPlayerRemoveMoney(cid, c.cost)
doPlayerAddItem(cid, c.item, c.item_count)
doCreatureSay(cid, "You bought ".. c.item_count .."x " .. getItemNameById(c.item) .. " for " .. c.cost .."." , TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "You need ".. cost .." gold coins!" , TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "You need ".. c.item_count .."x " .. getItemNameById(c.item) .. "!" , TALKTYPE_ORANGE_1)
end
return true
end