gerard95
Keep cool :)
- Joined
- Dec 31, 2011
- Messages
- 276
- Reaction score
- 16
I got a script from Otland, to give points per level. For ZnoteAcc, but it ain't working.
What's failing?![Eek! :eek: :eek:](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
And at login.lua -> registerCreatureEvent(cid, "pointsystem")
Thank you guys![/i]
What's failing?
Lua:
local t, storage = {
{160, 5},
{200, 10},
{245, 15},
}, 256
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 znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))
doCreatureSetStorage(cid, storage, i)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Points!')
doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' Advanced to ' .. v[1] .. 'lvl and got ' .. v[2] .. ' Points.')
break
end
end
return true
end
XML:
<event type="advance" name="Pointsystem" event="script" value="emporia/pointsystem.lua"/>
And at login.lua -> registerCreatureEvent(cid, "pointsystem")
Thank you guys![/i]