function onSay(cid, words, param, channel)
local shop = {
["100cc"] = {
id = 2160, count = 100, points = 3
},
["fire"] = {
id = 9933, count = 1, points = 4
},
["blood"] = {
id = 2798, count = 100, points = 1
},
["50cc"] = {
id = 2160, count = 50, points = 2
},
["soft"] = {
id = 6132, count = 1, points = 3
},
["haste"] = {
id = 2195, count = 1, points = 2
},
["demolegs"] = {
id = 2495, count = 1, points = 5
},
["solar"] = {
id = 2495, count = 1, points = 5
},
["long"] = {
id = 2390, count = 1, points = 3
},
["spellbook"] = {
id = 8918, count = 1, points = 3
}
}
local v = shop[param]
local check = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
if check >= v.points then
local item = doCreateItemEx(v.id, v.count)
if doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR then
doPlayerSendCancel(cid, "Sorry, you do not have the ability to carry this.")
else
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Shop: Added " .. v.count .."x " .. getItemInfo(v.id).name .. " to your inventory.")
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. v.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
else
doPlayerSendCancel(cid, "Sorry, you do not have enough premium points.")
end
return true
end