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

Especial Door Kind! :O

jpkulik

New Member
Joined
Mar 15, 2008
Messages
208
Reaction score
2
Hello Guys!
I wand to have a door, that's only lvl 50 or less can come in, and just players with skills 70 or less for example can come in.
I hope some one help-me, becouse i have no idea how to do that :D
Cya fellas, and im whaiting reply!
 
here try this:
PHP:
function onUse(cid, item, frompos, item2, topos)
	reqlevel = item.uid == 2001

	if reqlevel < 60 then
		if getPlayerLevel(cid) >= reqlevel then
			pos = getPlayerPosition(cid)

			if pos.x == topos.x then
				if pos.y < topos.y then
					pos.y = topos.y + 1
				else
					pos.y = topos.y - 1
				end
			elseif pos.y == topos.y then
				if pos.x < topos.x then
					pos.x = topos.x + 1
				else
					pos.x = topos.x - 1
				end
			else
				doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
		else
			doPlayerSendTextMessage(cid,22,'You need level 60 or less to pass this door.')
		end
		return 1
	else
		return 0
	end
end
Yours,
Clary
 
here try this:
PHP:
function onUse(cid, item, frompos, item2, topos)
	reqlevel = item.uid == 2001

	if reqlevel < 60 then
		if getPlayerLevel(cid) >= reqlevel then
			pos = getPlayerPosition(cid)

			if pos.x == topos.x then
				if pos.y < topos.y then
					pos.y = topos.y + 1
				else
					pos.y = topos.y - 1
				end
			elseif pos.y == topos.y then
				if pos.x < topos.x then
					pos.x = topos.x + 1
				else
					pos.x = topos.x - 1
				end
			else
				doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
		else
			doPlayerSendTextMessage(cid,22,'You need level 60 or less to pass this door.')
		end
		return 1
	else
		return 0
	end
end
Yours,
Clary

Just for Understand, i put the 2001 in action.xml, and in the door the action id 2001?
 
Back
Top