Blorin Mage
Member
- Joined
- Jan 26, 2012
- Messages
- 90
- Reaction score
- 13
{300, 10}--300 is level to recive points\10 is amount of points will be recived
open login.lua and rigster
after
open creaturescripts.xml and put this
Lua:
local t, storage = {
{300, 10}
}, 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 accounts SET premium_points=premium_points+'.. v[2] ..' WHERE 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
Lua:
registerCreatureEvent(cid,'points')
Lua:
registerCreatureEvent(cid, "ReportBug")
Lua:
<event type="advance" name="points" event="script" value="points.lua"/>
Last edited: