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

Windows Getting points on website at a certain level script

Cristian2387

New Member
Joined
Oct 2, 2014
Messages
34
Reaction score
0
hello i want a script that allows my players to get points on website to buy items on shop lets say at level 10 the player gets 130 points on website, thank you :)
 
Creaturescripts

points.lua
Code:
local t, storage = {
    {140, 30},
    {165, 30},
    {190, 30},
    {215, 40},
    {235, 40},
    {260, 40},
    {280, 100},
    {300, 100}
}, 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))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 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

In creaturescript xml
Code:
<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>

actions points.lua
Code:
local t, storage = {
    {140, 30},
    {165, 30},
    {190, 30},
    {215, 40},
    {235, 40},
    {260, 40},
    {280, 100},
    {300, 100}
}, 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 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 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, 25},
    {170, 30},
    {190, 35},
    {210, 40},
    {230, 45},
    {260, 50},
    {290, 55},
    {310, 60}
}, 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
 
Back
Top