this is my first post here so forgive me if i am not followed the rules
now here is my problem i have a scripts thats is changing items in game to points on site by the lever all is fine and the only problem is i didn't recieve the points on site
my tfs 0.4
now here is my problem i have a scripts thats is changing items in game to points on site by the lever all is fine and the only problem is i didn't recieve the points on site
my tfs 0.4
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Eazy M
local donation_ids = {2352, 8904, 2456} --donation ids
local position = getThingfromPos({x=1000, y=1000, z=7, 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
function addPoint(cid,p,t)
return doPlayerSendTextMessage(cid,22,"You have returned your donated item '"..getItemNameById(t).."' and added ".. p .." points to your current one.") and db.executeQuery("UPDATE `accounts` set `premium_points` = `premium_points` + '"..p.."' WHERE `name` = '"..getPlayerAccount(cid).."';")
end
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(5)
doTransformItem(item.uid, item.itemid + 1)
end
if item.itemid == 10030 then
changeIntoPoints(5)
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
Last edited by a moderator: