Brooke
Member
- Joined
- Mar 7, 2011
- Messages
- 70
- Reaction score
- 8
hello people! I'm having some problem with my advance points, tfs 0.4
Error:
Thanks![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Error:
Code:
[Error - CreatureScript Interface]
data/creaturescripts/scripts/points.lua:onAdvance
Description:
data/creaturescripts/scripts/points.lua:14: attempt to perform arithmetic on local 'points' (a boolean value)
stack traceback:
data/creaturescripts/scripts/points.lua:14: in function <data/creaturescripts/scripts/points.lua:9>
Lua:
local player = {
{level = 200, points = 25},
{level = 300, points = 50},
{level = 400, points = 75},
{level = 500, points = 100}
}
local storage = 15999
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
Thanks