local config = {
points=200,
storage=23421,
level=300
}
function onAdvance(cid, skill, oldLevel, newLevel)
if(oldLevel<config.level and newLevel >=config.level) then
if(getPlayerStorageValue(cid,config.storage)==-1) then
local result_plr = db.getResult("SELECT * FROM accounts WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
local money = tonumber(result_plr:getDataInt("premium_points"))
money = money+config.points
db.executeQuery("UPDATE `accounts` SET `premium_points` = " .. money .. " WHERE id = " .. getPlayerAccountId(cid) .. ";")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations you have recived " .. config.points .." premium points.")
setPlayerStorageValue(cid,config.storage,1)
end
end
return true
end