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

SHOP POINTS ON ADVANCEMENT

Pakojerte

New Member
Joined
Oct 25, 2011
Messages
30
Reaction score
0
Hello dear community

I know there is another thread about this request.

But i have followed all the steps from previous threads and it does not work.

I would like to request your help on a script to give shop points on lvl advancement, at lvl 50 give 10 points, lvl 100 give 20 points and so on.

Im actually using TFS 1.0 tibia 10.41 and Znote Acc-Master original

Looking forward for your positive comments.
 
oki, just for good order sake, points added in the shop on znote(webpage)

By the way, im looking for scripters in my OT, maybe you want to be part of the team, i have dedicated server, paid for 1 year, if you accept would be nice @ghettobird
 
Last edited by a moderator:
Okay so I don't have the client for 10.41 or a tfs 1.0 anyway so I just took a quick look at the one I made for tfs 0.3.6 & tried to edited some functions...

Please note that you may face some bugs (I'm pretty sure I did something wrong but I can't think straight at 1 AM) so if you face any problems please post here & I'll gladly help you (or any other member)

Code:
local t, storage = {
{50, 10},
{100, 20}
}, 256
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill ~= SKILL__LEVEL then
        return true
            end
if newLevel >= v[1] then
    db.executeQuery('UPDATE accounts SET premium_points=premium_points+'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))
        doCreatureSay(cid, Congratulations! You have advanced to level ' .. v[1] .. ' and you have recived '.. v[2] ..' Premium Points!', TALKTYPE_ORANGE_1)
end
    return true
        end
What this will do:
  • check forthe level & premmy points to add (50,10 for example) so you can add as many as you want, just copy one of the boxes & it should work.
  • it will check for the level (the value on the left) & execute a query in the premium points section in your phpmyadmin database.
  • And finally it will message your player saying you got level 50 for example & received 10 premium points.

PS: This is a very basic system, players may find a way to bug it or so (as stated its 1 AM here & I can't think of what I missed but I'm pretty sure I missed something important XD)

Good luck.
 
Thnks mate, as what i see, will need to add some word to check storage id since if the player dies and lvl again to 50 will receive points, i think thats the bug could be found, also will edit premium_points cause i have it on znote_accounts =)
 
Okay, will fix storage ids now (i hope it works on tfs 1.0 cus im too lazy to keep reading the new stuff that they added)

EDIT:
I hope this works.
Code:
local t, storage = {
{50, 10},
{100, 20}
}, 256
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill ~= SKILL__LEVEL then
        return true
            end
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))
        doCreatureSay(cid, Congratulations! You have advanced to level ' .. v[1] .. ' and you have recived '.. v[2] ..' Premium Points!', TALKTYPE_ORANGE_1)
end
    end
        return true
            end
 
Back
Top