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

Point system

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
i have point system but when player get lvl 250 don't add point in site why ??
but points add in mysql accounts
Code:
local t, storage = {
  -- level -- amount points (delete this line)..
    {250, 30}

}, 259

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!')
        end
    end
    return true
    end

im use 0.4
 
Code:
local t, storage = {
  -- level -- amount points (delete this line)..
    {250, 30}

}, 259

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.Query('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!')
        end
    end
    return true
    end
 
Code:
local t, storage = {
[250] = 30,
[300] = 50
},4001201
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= SKILL__LEVEL then return true end
        if t[newLevel] and getPlayerStorageValue(cid, storage) < newLevel then
            db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. t[newLevel] ..' WHERE id=' .. getPlayerAccountId(cid))
            setPlayerStorageValue(cid, storage, newLevel)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations! You have advanced to level ' .. newLevel .. ' and you have earned '.. t[newLevel] ..' Premium Points!')
        end
    return true
    end
 
register event in the player...

Code:
<event type="advance" name="SendPoints" event="script" value="script name.lua" />

login.lua add
Code:
registerCreatureEvent(cid, "SendPoints")
 
Code:
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + ".. v[2] .." WHERE `id` = "..getPlayerAccount(cid))
 
limos i need script give premium points but it give points 1 time for each account i need this script add 30 point in lvl 250 but for account not char if account have 3-4 char point add one time only
 
Last edited:
Back
Top