• 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 Added free points.. Gesior 2012 problem!!!!

wikutag

SoulBound 8.6 100% custom
Joined
Dec 27, 2012
Messages
305
Reaction score
0
Location
United states Kentucky
nexipz.png

Someone help fast please!!! mysql-real quiery problem!!! I think i need a table for it.. Help!??! Player does not recieve ingame points
 
Just change the fields so it match with the ones Gesior is using,

znote_accounts -> accounts
points -> premium_points
account_id -> id

db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
 
Creature script
Code:
local t, storage = {
    {180, 10},
    {200, 20},
    {220, 20},
    {240, 20},
    {260, 20},
    {280, 20},
    {300, 20},
    {320, 20}
}, 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 znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))
            doCreatureSetStorage(cid, storage, i)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!')
            doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' advenced to ' .. v[1] .. 'lvl and got ' .. v[2] .. ' ptz to sms shop.')
            break
        end
    end
    return true
end

Action script
Code:
local t, storage = {
    {180, 10},
    {200, 20},
    {220, 20},
    {240, 20},
    {260, 20},
    {280, 20},
    {300, 20},
    {320, 20}
}, 256
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= SKILL__LEVEL then
        return true
    end
    for i = 1, #t do
        local v = t
        if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then
            db.executeQuery('UPDATE znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))
            doCreatureSetStorage(cid, storage, i)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!')
            doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' advenced to ' .. v[1] .. 'lvl and got ' .. v[2] .. ' ptz to sms shop.')
            break
        end
    end
    return true
end

--------------------------

local t, storage = {
    {140, 0},
    {170, 0},
    {190, 0},
    {210, 0},
    {230, 0},
    {260, 0},
    {290, 0},
    {310, 0}
}, 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_WARNING, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!')
            doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' advenced to ' .. v[1] .. 'lvl and got ' .. v[2] .. ' ptz to sms shop.')
            break
        end
    end
    return true
end
 
No, tfs is the name of your database.

Replace your current query with this,
Code:
db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
 
Change:
Code:
db.executeQuery('UPDATE znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))

To:
Code:
db.executeQuery('UPDATE accounts SET premium_points=points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
In both scripts, pretty shure it will work
 
Back
Top