• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Znote Shop Question 0.4DEV

iDramatiik

http://realia.no-ip.info/ RLMap 10.41 Free Points
Joined
Apr 15, 2014
Messages
156
Reaction score
15
Location
North America
I was just wondering as I've come across almost every post on otland about this and found nothing to help me so here goes my question

I would like to give free points to my players that reach X amount of level's as has been already created as a creaturescript. Here's the odd part. None of them work for me

What I Use

Znote AAC
0.4DEV 8.6 Server
I added all creaturescripts properly / login.lua code/ creaturescripts.xml code. I have changed the parts where you "UPDATE 'znote_accounts SET points=points+' etc...

When I level up a new character it doesnt display the advancement and notification of receiving points like it should, nor does it add the points to the characters account. I am really stumped here... and yes my shop system fully works for real donations etc.

Thanks in advance for any help!

Code:
local t, storage = {
{150, 10},
{200, 20},
{275, 30}
}, 256

function onAdvance(cid, skill, oldLevel, newLevel)
if skill ~= SKILL__LEVEL then
return true
end
for i = 1, #t do
local v = t
if newLevel >= v[1] and getCreatureStorage(cid, storage) < i then
db.query('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 recived '.. v[2] ..' Premium Points!')
doBroadcastMessage('Congratulations! ' .. getCreatureName(cid) .. ' Advenced To LeveL ' .. v[1] .. ' And Got ' .. v[2] .. ' Premium Points.')
end
end
return true
end



That is the points.lua script that I am using.
 
Last edited by a moderator:
It was missing because of the missing Lua tags, it's to get the right values in the tables.
t[1] means first value of the table t, which is {150, 10},
Then you can get first value of that by using t[1][1]. i is from the for loop, so i stands for 1, 2 and 3.
 
Back
Top