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

Very big problem with SERVER (watch this)

Axelor

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

My server got a very big problem with something.

When some1 try to go up a ladder, yes he can go up!
but when some1 puts a mwall on the tile above the ladder, Than u arent able to go up!!
this is a big bug!

Some1 can help this?

I use 0.4 rev 3858
 
Last edited:
Post actions/scripts/other/teleport.lua

PHP:
            local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
		return false
	end

	fromPosition.stackpos = STACKPOS_GROUND
	if(isInArray(UP_FLOORS, item.itemid)) then
		fromPosition.z = fromPosition.z - 1
		fromPosition.y = fromPosition.y + 1
		if(doTileQueryAdd(cid, fromPosition, 4, false) ~= RETURNVALUE_NOERROR) then
			fromPosition.y = fromPosition.y - 2
		end
	else
		fromPosition.z = fromPosition.z + 1
	end

	if(doTileQueryAdd(cid, fromPosition, 4, false) ~= RETURNVALUE_NOERROR) then
		return false
	end

	local pos, dir = getCreaturePosition(cid), SOUTH
	if(pos.x < fromPosition.x) then
		dir = EAST
	elseif(pos.x == fromPosition.x) then
		if(pos.y == fromPosition.y) then
			dir = getCreatureLookDirection(cid)
		elseif(pos.y > fromPosition.y) then
			dir = NORTH
		end
	elseif(pos.x > fromPosition.x) then
		dir = WEST
	end

	doTeleportThing(cid, fromPosition, false)
	doCreatureSetLookDirection(cid, dir)
	return true
end
 
dunno if it'll work, but try changing the doTeleportThing(cid, fromPosition, false) at the very bottom to just doTeleportThing(cid, fromPosition) and post the results
 
..
LUA:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
		return false
	end

	local check = false
	fromPosition.stackpos = STACKPOS_GROUND
	if(isInArray(UP_FLOORS, item.itemid)) then
		fromPosition.z = fromPosition.z - 1
		fromPosition.y = fromPosition.y + 1
		if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
			local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
			if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
				fromPosition.y = fromPosition.y - 2
			else
				check = true
			end
		end
	else
		fromPosition.z = fromPosition.z + 1
	end

	if(not check and doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
		local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
		if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
			return false
		end
	end

	local pos, dir = getCreaturePosition(cid), SOUTH
	if(pos.x < fromPosition.x) then
		dir = EAST
	elseif(pos.x == fromPosition.x) then
		if(pos.y == fromPosition.y) then
			dir = getCreatureLookDirection(cid)
		elseif(pos.y > fromPosition.y) then
			dir = NORTH
		end
	elseif(pos.x > fromPosition.x) then
		dir = WEST
	end

	doTeleportThing(cid, fromPosition, false)
	doCreatureSetLookDirection(cid, dir)
	return true
end
 
Back
Top