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

problem with the premmium door

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPromotionLevel(cid) >= 1 then
if getCreaturePosition(cid).y < toPosition.y then
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
else
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
end
else
doPlayerSendCancel(cid, "You must be premium to pass this door.")
end
return TRUE
end


and here is the problem:

[04/01/2011 16:27:40] Lua Script Error: [Action Interface]
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua: onUse
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua:2: attempt to call global 'getPlayerPromotionLevel' (a nil value)
[04/01/2011 16:27:40] stack traceback:
[04/01/2011 16:27:40] [C]: in function 'getPlayerPromotionLevel'
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua:2: in function <data/actions/scripts/other/premiumdoor.lua:1>
 
0.2, it seems.
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPremium(cid) == TRUE then
		doTeleportThing(cid, {x=toPosition.x, y=toPosition.y+(getThingPos(cid).y and 1 or -1), z=toPosition.z})
	else
		doPlayerSendCancel(cid, 'You must be premium to pass this door.')
	end
	return TRUE
end
 
to not make an another thread I want to know if someone knows how to fix this in my addon script

[05/01/2011 00:32:19] data/npc/scripts/fulladdons.lua:33: attempt to call global 'getItemNameById' (a nil value)
[05/01/2011 00:32:19] stack traceback:
[05/01/2011 00:32:19] [C]: in function 'getItemNameById'
[05/01/2011 00:32:19] data/npc/scripts/fulladdons.lua:33: in function 'callback'
[05/01/2011 00:32:19] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[05/01/2011 00:32:19] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[05/01/2011 00:32:19] data/npc/lib/npcsystem/keywordhandler.lua:128: in function 'processMessage'
[05/01/2011 00:32:20] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[05/01/2011 00:32:20] data/npc/scripts/fulladdons.lua:8: in function <data/npc/scripts/fulladdons.lua:8>

for what I must change "getItemNameById"?
 
@cykotitan
I have a problem in your script... when I can enter to the room when Im premmy and dont has problem... the problem is when you try to exit from the room and door doesnt open

I have tfs 0.2.9
 
Back
Top