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
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
Dude you're quick.
I was doing a match in FIFA and I saw your postI'm way too slow. Works with both Gesior and ZnoteAAC though.
https://otland.net/threads/tfs-1-x-award-premium-points-on-level-advance.237523/
Dude you're quick.