• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved bug at free points

4Muki4

HOROHOROHORO
Joined
May 1, 2012
Messages
757
Reaction score
72
i get this bug, i dont revive my points but it broadcast it
Code:
[25/5/2013 6:21:46] mysql_real_query(): UPDATE accounts SET premium_points=premium_points+20 WHERE id=2 - MYSQL ERROR: Unknown column 'premium_points' in 'field list' (1054)
[25/5/2013 6:21:46] > Broadcasted message: "Congratulations! Tes Pally Advenced To LeveL 250 And Got 20 Premium Points.".
and here script
LUA:
local t, storage = {
	{300, 10}
}, 256
 
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= SKILL__LEVEL then
        return true
    end
    for i = 1, #t do
        local v = t[i]
        if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then
            db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
            doCreatureSetStorage(cid, storage, i)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have recived '.. v[2] ..' Premium Points!')
			doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' Advenced To LeveL ' .. v[1] .. ' And Got ' .. v[2] .. ' Premium Points.')
        end
    end
    return true
end
rep+
 
Last edited:
You could have fixed this atleast 4h earlier if you would have read the error msg, Its always like this just read it some are random bullshit and the other part says in plain english THE SERVER IS ... AT LINE ... ex.
WibbenZ
 
But then its not that script, its smth you setup wrong with znote acc, it might use pacc points or ppoints etc.. You have to look in the database, and use the same column name as in the script and the homepage.
Mby someone who is familier with znote acc can assist here? xD
WibbenZ
 
Look which column name for premium points it is using.
If it is using a different one, you can use that in your script instead of premium_points.
 
If you're using Znote AAC then modify the query. :p

LUA:
db.executeQuery('UPDATE znote_accounts SET points=points+' .. v[2] .. ' WHERE account_id=' .. getPlayerAccountId(cid))
 
thank you ninja & limos for helping and thanks to WibbenZ for the comments all rep you all three
yea wibbenz i could use my logic and read the bug.
 
Please... create a new thread insted of bumping old threads.
The problem was that he was trying to add points to the column Gesior uses while he used znote I suppose.
What is your error etc.
 
this didnt work for me :\
Try this one
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local addPoints = 1
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. addPoints .. " WHERE `account_id` = " .. getPlayerAccountId(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, addPoints .. " premium points have been added to your account.")
doRemoveItem(item.uid, 1)
return true
end
 
Back
Top