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

Solved reward on certain lvl -> shop points

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,686
Solutions
127
Reaction score
2,134
Does someone have working reward script for tfs 1.2? When player advance to level 250,300,350 he is getting rewards 100,200,400 points.
 
I need someone who will fix it to work with tfs 1.2. So any scripter ?
 
I could write one, although i encourage you to write or at least start to write it yourself, support is really for existing scripts / problems.
You might want to go to requests or use the search box on the forums for a solution.
 
I have script but it dont work. Look:
Code:
local t, storage = {
  -- level -- amount points (delete this line)..
    {10, 50},
    {350, 100},
}, 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
 
I have script but it dont work. Look:
Code:
local t, storage = {
  -- level -- amount points (delete this line)..
    {10, 50},
    {350, 100},
}, 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



-- level -- amount points (delete this line)..

(lol sorry, I forgot you comment lines with -- @ lua).
 
Code:
local player = {
        {level = 10, points = 50},
        {level = 350, points = 100}
    }
local storage = 15000

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL then
        for i = 1, #player do
            if newLevel >= player[i].level and getCreatureStorage(cid, storage) < i then
                local points = db.executeQuery('SELECT `premium_points` FROM `accounts` WHERE `id`==' .. getPlayerAccountId(cid) ..';')
                db.executeQuery('UPDATE `accounts` SET `premium_points`='.. (points + player[i].points ) ..' WHERE `id`==' .. getPlayerAccountId(cid) .. ';')
                doCreatureSetStorage(cid, storage, i)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations! You have advanced to level ' .. newLevel .. ' and you have earned '.. player[i].points ..' Premium Points!')
            end
        end
    end
    return true
end
 
Last edited:
Back
Top