• 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!

Free points for lvl (gesior)

Rider Ones

New Member
Joined
Jan 12, 2009
Messages
104
Reaction score
2
Hi im using the gesior 2012 0.3.6

Hello I need the players receive points on some level, such a level 100 = 25 points at lvl 120 = 25 to level 150 = 30 points!

Someone could help me with this script for Gęsior acc?
 
creaturescripts ->pointsforlvl.lua
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

creaturescripts.xml
<event type="advance" name="Pointsforlvl" event="script" value="pointsforlvl.lua"/>

login.lua
registerCreatureEvent(cid, "pointsforlvl")
 
Last edited by a moderator:
i just see in your script this.

Lua:
db.executeQuery('UPDATE znote_accounts SET points=points+'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))

this works on GESIOR 2012? i see znote_accounts
 
Last edited by a moderator:
You can adjust the table names to match the ones in your database.

Table names that you should check and change if necessary are bolded:
db.executeQuery('UPDATE znote_accounts SET points = points +'.. v[2] ..' WHERE account_id=' .. getPlayerAccountId(cid))

So for example I am using Gesior 2012 with the database for TFS 0.3.7 and mine would look like this:

db.executeQuery('UPDATE accounts SET premium_points = premium_points +'.. v[2] ..' WHERE id=' .. getPlayerAccountId(cid))

I hope it was helpful. ;)
 
Back
Top