Imereth Popis
dopera.sytes.net
Hello guys,
I am using a script modified to the new database from the latest @Znote version and it's not working...
I created at data/creaturescripts/creaturescripts.xml this line:
then I go into data/creaturescripts/scripts and I create a LUA file (advance.lua) with the following code:
It is not working (tested). Can somebody explain me why or tell me if something is wrong?
Thanks you in advance!
I am using a script modified to the new database from the latest @Znote version and it's not working...
I created at data/creaturescripts/creaturescripts.xml this line:
XML:
<event type="advance" name="pointsforlvl" event="script" value="advance.lua"/>
then I go into data/creaturescripts/scripts and I create a LUA file (advance.lua) with the following code:
Lua:
local t, storage = {
{90, 100},
{100, 100},
{110, 100},
{120, 100},
{130, 100},
{140, 100},
{150, 100},
}, 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 getStorage(storage) < i then
db.executeQuery('UPDATE znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))
doSetStorage(storage, i)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. v[1] .. ' and you have earned '.. v[2] ..' Premium Points!')
doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' advenced to ' .. v[1] .. 'lvl and got ' .. v[2] .. ' ptz to sms shop.')
break
end
end
return true
end
It is not working (tested). Can somebody explain me why or tell me if something is wrong?
Thanks you in advance!