All pastes #2054315 Raw Edit

Something

public text v1 · immutable
#2054315 ·published 2011-05-05 18:53 UTC
rendered paste body
--- Vocational Doors by Admin Saint

function onUse(cid, item, frompos, item2, topos)
		vocationsub = item.uid

		if vocationsub == 1555 then
			voc = 1
		end
		if vocationsub == 1556 then
			voc = 2
		end
		ifvocationsub == 1557 then
			voc = 3
		end
		ifvocationsub == 1558 then
			voc = 4
		
			
			getplayervocation(cid) == 1 then
				
			if (getplayervocation(cid) == voc) 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 are not the right vocation to go through this door.')
			end
		
			return 1
		else
			return 0
		end