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

when ur on a level [U receive Shop points] HELP [repp+]

Axelor

Member
Joined
Sep 2, 2010
Messages
505
Reaction score
9
Hiho,

how to make it so when somone reachs level 160 he receive automatic 30 shop points??

I like to have it for those levels

160lvl - 30ptz to sms shop

190lvl - 30ptz to sms shop

220lvl - 30ptz to sms shop

250lvl - 30ptz to sms shop

280lvl - 30ptz to sms shop

300lvl - 30ptz to sms shop

315lvl - 30ptz to sms shop

330lvl - 30ptz to sms shop


some1 have a script for this?

repp+
 
:p you should've told me to make it otherwise.
Lua:
local t, storage = {
	{160, 30},
	{190, 30},
	{220, 30},
	{250, 30},
	{280, 30},
	{300, 30},
	{315, 30},
	{330, 30}
}, 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 earned '.. v[2] ..' Premium Points!')
		end
	end
	return true
end

now everyone will receive points at those levels? right
 
:p you should've told me to make it otherwise.
Lua:
local t, storage = {
	{160, 30},
	{190, 30},
	{220, 30},
	{250, 30},
	{280, 30},
	{300, 30},
	{315, 30},
	{330, 30}
}, 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 earned '.. v[2] ..' Premium Points!')
		end
	end
	return true
end

still not working m8,
I did do /reload creaturescript and than when some1 pasted level 160,
there didnt came any broadcast nor he received points
 
can someojne remake this script /\ . that it also broadcast becouse this one aint broadcasting .. only player getting message for heself.
 
Can someone help me - when I reach level 250, it doesn't work

This is my code:
Login:
Code:
function onLogin(cid) 
    if os.difftime(os.time, getPlayerStorageValue(cid, storTime)) >= (24 * 60 * 60 * 1000) then 
        setPlayerStorageValue(cid, storTime, 0) 
        setPlayerStorageValue(cid, Stor, 0)     
    end 
    return TRUE 
end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "pointsforlvl")

Creaturescripts:
Code:
	<event type="advance" name="pointsforlvl" event="script" value="points.lua"/>

Points.lua
Code:
local t, storage = {
	{250, 25}, 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 accounts SET premium_points=premium_points+'.. v[2] ..' WHERE 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!')
			break
		end
	end
	return true
end

I want my points.lua to only reward 25 points @ level 250 - but it isn't working, theres on errors either in the console.
 
Lua:
local t, storage = { 
              {250, 25},
}, 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 earned '.. v[2] ..' Premium Points!')
        end
    end
    return true
end
 
@up
Omg ninja

when ur on a level [U receive Shop points] HELP [repp+]
Started by Axelor, 27th February 2011 16:19

Look the post above me, cunt. <_<

I would take a closer look next time if I were you.. :)
 
Lua:
local t, storage = { 
              {250, 25},
}, 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 earned '.. v[2] ..' Premium Points!')
        end
    end
    return true
end

I did what you said, and this came up

[02/08/2012 21:32:01] [Error - CreatureScript Interface]
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:eek:nAdvance
[02/08/2012 21:32:01] Description:
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:12: attempt to call field 'executeQuery' (a nil value)
[02/08/2012 21:32:01] stack traceback:
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:12: in function <data/creaturescripts/scripts/points.lua:5>

Also - All my starter items appear on the floor.
 
I did what you said, and this came up

[02/08/2012 21:32:01] [Error - CreatureScript Interface]
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:eek:nAdvance
[02/08/2012 21:32:01] Description:
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:12: attempt to call field 'executeQuery' (a nil value)
[02/08/2012 21:32:01] stack traceback:
[02/08/2012 21:32:01] data/creaturescripts/scripts/points.lua:12: in function <data/creaturescripts/scripts/points.lua:5>

Also - All my starter items appear on the floor.

Change from db.executeQuery to db.Query.
 
Change from db.executeQuery to db.Query.

[02/08/2012 21:38:49] [Error - CreatureScript Interface]
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:eek:nAdvance
[02/08/2012 21:38:49] Description:
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:12: attempt to call field 'Query' (a nil value)
[02/08/2012 21:38:49] stack traceback:
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:12: in function <data/creaturescripts/scripts/points.lua:5>

It came up with this error this time.
 
[02/08/2012 21:38:49] [Error - CreatureScript Interface]
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:eek:nAdvance
[02/08/2012 21:38:49] Description:
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:12: attempt to call field 'Query' (a nil value)
[02/08/2012 21:38:49] stack traceback:
[02/08/2012 21:38:49] data/creaturescripts/scripts/points.lua:12: in function <data/creaturescripts/scripts/points.lua:5>

It came up with this error this time.

What rev are you using?
 
Uh there should be something like r.xxxx the xxxx is the rev number.
Also, sorry it's supposed to be db.query not db.Query.

Sent you a PM.

I get these errors:
[02/08/2012 21:55:35] [Error - CreatureScript Interface]
[02/08/2012 21:55:35] buffer:eek:nLogin
[02/08/2012 21:55:35] Description:
[02/08/2012 21:55:35] (luaDoAddContainerItem) Container not found

[02/08/2012 21:55:35] [Error - CreatureScript Interface]
[02/08/2012 21:55:35] buffer:eek:nLogin
[02/08/2012 21:55:35] Description:
[02/08/2012 21:55:35] (luaDoAddContainerItem) Container not found

[02/08/2012 21:55:43] [Error - CreatureScript Interface]
[02/08/2012 21:55:43] data/creaturescripts/scripts/points.lua:eek:nAdvance
[02/08/2012 21:55:43] Description:
[02/08/2012 21:55:43] data/creaturescripts/scripts/points.lua:12: attempt to call field 'query' (a nil value)
[02/08/2012 21:55:43] stack traceback:
[02/08/2012 21:55:43] data/creaturescripts/scripts/points.lua:12: in function <data/creaturescripts/scripts/points.lua:5>

Top errors are firstitems.xml errors
The bottom error is related to the points script (but you can probably see that)
 
Lua:
local t, storage = { 
              {250, 25},
}, 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.query('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 earned '.. v[2] ..' Premium Points!')
        end
    end
    return true
end

...
or made by you search your function query in
data/lib/100-compat.lua
open and search: query

now are this: [in my rev] you rev have others?
example:
Lua:
db.updateQueryLimitOperator = db.updateLimiter
db.stringComparisonOperator = db.stringComparer
db.stringComparison = db.stringComparer
db.executeQuery = db.query

or you REV have others..
 
:p you should've told me to make it otherwise.
Lua:
local t, storage = {
	{160, 30},
	{190, 30},
	{220, 30},
	{250, 30},
	{280, 30},
	{300, 30},
	{315, 30},
	{330, 30}
}, 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 earned '.. v[2] ..' Premium Points!')
		end
	end
	return true
end
Hey man ! Thanks for the script! but there is one problem....I am getting the message of the premium points ....but i am not getting any connected to my database.......maybe because I am using znoteaac V1.3 public......pls tell me how to connected to znote_accounts? thanks :D

- - - Updated - - -

:p you should've told me to make it otherwise.
Lua:
local t, storage = {
	{160, 30},
	{190, 30},
	{220, 30},
	{250, 30},
	{280, 30},
	{300, 30},
	{315, 30},
	{330, 30}
}, 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 earned '.. v[2] ..' Premium Points!')
		end
	end
	return true
end

How can I connect to znote_accounts.......I am getting the message but I am not getting the points on my shop on website .....pls help me :(
 
Back
Top