• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Items Into points Lever

Imfreezing

Krossa Kapitalismen
Joined
Jun 7, 2012
Messages
1,009
Solutions
1
Reaction score
88
Location
Edron
hello otland community,i was woundering if you could help me with this script
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
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
 
If you count from the ground up, what iteration is your item on? i.e. do you have anything below the item itself? a counter perhaps? If so, try raising the stackpos to 2, or if you have two items below it, set it to 3, and so on, so forth.
 

Similar threads

Back
Top