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

Points Script

Script for online players which level xx
data/creaturescripts/scripts/points.lua
LUA:
local t, storage = {
  -- level -- amount points (delete this line)..
    {100, 100},
    {200, 70},
    {300, 65},
    {400, 50},
    {500, 40}
}, 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
data/creaturescripts/creaturescripts.xml
XML:
<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>
data/creaturescripts/scripts/login.lua , end of file , add this:
XML:
registerCreatureEvent(cid, "pointsforlvl")

Credits goes to Adrenaline and REPP++ to me would be nice :p
 
Script for online players which level xx
data/creaturescripts/scripts/points.lua
LUA:
local t, storage = {
  -- level -- amount points (delete this line)..
    {100, 100},
    {200, 70},
    {300, 65},
    {400, 50},
    {500, 40}
}, 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
data/creaturescripts/creaturescripts.xml
XML:
<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>
data/creaturescripts/scripts/login.lua , end of file , add this:
XML:
registerCreatureEvent(cid, "pointsforlvl")

Credits goes to Adrenaline and REPP++ to me would be nice :p

Is that points if you reach a certain lvl? like you reach lvl 180 u get 100 points automatically
 
I cant get my script work....

local t, storage =
{250, 4},

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 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
 
Back
Top