• 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!

Lever give points on site

Misokoko

New Member
Joined
Mar 29, 2013
Messages
126
Reaction score
0
hey guys i hope can someone help with i got a script to get points on site from the lever when i use th lever i got this error in console :
Code:
[18:1:52.710] mysql_real_query(): UPDATE `accounts` set `premium_points` = `premium_points` + '5' WHERE `account_id` = 'okaoka'; - MYSQL ERROR: Unknown column 'account_id' in 'where clause' (1054)
and didn't recieved my points on site i hope someone could help me
my tfs 0.4 and my script ezay
Code:
-- by andu @ otland.net
local position = {x = 992, y = 1000, z = 7, stackpos = 1} -- position to put the items on

local donationItems = {
    [1] = {itemid = 2456, points = 5},
    [2] = {itemid = 8904, points = 5},
 
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 10029 or item.itemid == 10030 then
        local thing, check = getThingFromPos(position), 0
        for i = 1, #donationItems do
            if thing.itemid == donationItems[i].itemid then
                if doRemoveItem(thing.uid, 1) then
                    doPlayerSendTextMessage(cid,22,"You have returned your donated item '"..getItemNameById(donationItems[i].itemid).."' and added "..donationItems[i].points.." points to your current one.")
                    db.query("UPDATE `accounts` set `premium_points` = `premium_points` + '"..donationItems[i].points.."' WHERE `account_id` = '"..getPlayerAccount(cid).."';")
                    doPlayerSendCancel(cid, "You received " ..donationItems[i].points.. " point(s).")
                else
                    doPlayerSendCancel(cid, "Could not remove the item.")
                end
                check = 1
            end
        end
        if check == 0 then
            doPlayerSendCancel(cid, "Donation item not found.")
        end
        doTransformItem(item.uid, item.itemid - ((item.itemid - 10029) * 2) + 1) -- this is beauty of math, by andu (a - ((a - 10) * 2) + 1)
    end
    return true
end
 
Judging by that error you posted, first thing you should do is open your database and check the 'accounts' table if it contains a column called account_id.
If it's not called like that, but by some other name, just put that other name inside of your script instead of account_id then re-run the script again and see what happens.
 
Judging by that error you posted, first thing you should do is open your database and check the 'accounts' table if it contains a column called account_id.
If it's not called like that, but by some other name, just put that other name inside of your script instead of account_id then re-run the script again and see what happens.
now i modified the script and it's like that but i don't get points or errors :D is there is something should be added in db !
Code:
-- by andu @ otland.net
local position = {x = 992, y = 1000, z = 7, stackpos = 1} -- position to put the items on

local donationItems = {
    [1] = {itemid = 2456, points = 5},
    [2] = {itemid = 8904, points = 5}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 10029 or item.itemid == 10030 then
        local thing, check = getThingFromPos(position), 0
        for i = 1, #donationItems do
            if thing.itemid == donationItems[i].itemid then
                if doRemoveItem(thing.uid, 1) then
                    doPlayerSendTextMessage(cid,22,"You have returned your donated item '"..getItemNameById(donationItems[i].itemid).."' and added "..donationItems[i].points.." points to your current one.")
                    db.query("UPDATE `accounts` set `premium_points` = `premium_points` + '"..donationItems[i].points.."' WHERE `name` = '"..getPlayerAccountId(cid).."';")
                    doPlayerSendCancel(cid, "You received " ..donationItems[i].points.. " point(s).")
                else
                    doPlayerSendCancel(cid, "Could not remove the item.")
                end
                check = 1
            end
        end
        if check == 0 then
            doPlayerSendCancel(cid, "Donation item not found.")
        end
        doTransformItem(item.uid, item.itemid - ((item.itemid - 10029) * 2) + 1) -- this is beauty of math, by andu (a - ((a - 10) * 2) + 1)
    end
    return true
end

Edite : btw it was working before on gesoir but now i switched to Znote AAc
 
Why are you looking for an account NAME that matches an account ID?
You edited that completely wrong, lol.
mm so tell me the right way :/

now i modified 'name' to' id' and used it worked but points doesn't existed on site and when enterd the db i found that i got got points so i think the problem is on site not into script . Any ideas !!
 
Last edited by a moderator:
Code:
-- by andu @ otland.net
local position = {x = 992, y = 1000, z = 7, stackpos = 1} -- position to put the items on

local donationItems = {
    [1] = {itemid = 2456, points = 5},
    [2] = {itemid = 8904, points = 5}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 10029 or item.itemid == 10030 then
        local thing, check = getThingFromPos(position), 0
        for i = 1, #donationItems do
            if thing.itemid == donationItems[i].itemid then
                if doRemoveItem(thing.uid, 1) then
                    doPlayerSendTextMessage(cid,22,"You have returned your donated item '"..getItemNameById(donationItems[i].itemid).."' and added "..donationItems[i].points.." points to your current one.")
                    db.query("UPDATE `accounts` set `premium_points` = `premium_points` + '"..donationItems[i].points.."' WHERE `id` = '"..getPlayerAccountId(cid).."';")
                    doPlayerSendCancel(cid, "You received " ..donationItems[i].points.. " point(s).")
                else
                    doPlayerSendCancel(cid, "Could not remove the item.")
                end
                check = 1
            end
        end
        if check == 0 then
            doPlayerSendCancel(cid, "Donation item not found.")
        end
        doTransformItem(item.uid, item.itemid - ((item.itemid - 10029) * 2) + 1) -- this is beauty of math, by andu (a - ((a - 10) * 2) + 1)
    end
    return true
end

Try this, as suggested by noob Zenorex
i did that see my comment ( now i modified 'name' to' id' and used it worked but points doesn't existed on site and when enterd the db i found that i got got points so i think the problem is on site not into script . Any ideas !! ) you understand what i mean !
 
Back
Top