Imfreezing
Krossa Kapitalismen
hello otland community,i was woundering if you could help me with this script
it dosn't detect donation items,it just says "DOnation Item not found,Yes the positions is right etc and items,
also i was woundering if you could make it so you could set points for each item?
thanks
Imfreezing
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Eazy M
local donation_ids = {2352, 8904, 2456} --donation ids
local position = getThingfromPos({x=995, y=999, z=8, stackpos=1}) -- position to put the items on
function changeIntoPoints()
if (isInArray(donation_ids, position.itemid)) then
if doRemoveItem(position.uid,1) then
local points = 5 -- how much points to receive
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid))
doPlayerSendCancel(cid, "You received " .. points .. " point(s).")
else
doPlayerSendCancel(cid, "Could not remove the item.")
end
else
doPlayerSendCancel(cid, "Donation item not found.")
end
end
if item.itemid == 10029 then
changeIntoPoints()
doTransformItem(item.uid, item.itemid + 1)
end
if item.itemid == 10030 then
changeIntoPoints()
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
also i was woundering if you could make it so you could set points for each item?
thanks
Imfreezing