local pos = {x=1000,y=1000,z=7, stackpos = 1} -- pos where item will be placed
local itemm = {
[2466] = {pointsBack = 14}, --[itemid] = {pointsBack = item point}
[2467] = {pointsBack = 15}
}
function onUse(cid, item, frompos, item2, topos)
local con = itemm[getThingFromPos(pos).itemid]
if(not con) then
doPlayerSendCancel(cid,"This isnt a donation item")
else
doCreatureSay(cid, "You have got rid of "..getItemNameById(getThingFromPos(pos).itemid).." and recievd you points back.", TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + '"..con.pointsBack.."' WHERE `id`= '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
doRemoveItem(getThingFromPos(pos).uid)
end
return item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)
end