Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- level = 100,
- vocations = {1, 2, 3, 4},
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if not isInArray(config.vocatios, getPlayerVocation(cid)) then
- return doPlayerSendCancel(cid, "Sorry, your vocation can't use this.")
- end
- if getPlayerLevel(cid) < config.level then
- return doPlayerSendCancel(cid, "Sorry, you don't have level.")
- end
- if toPosition.x == CONTAINER_POSITION then
- return doPlayerSendCancel(cid, "Sorry, not possible")
- end
- if itemEx.itemid > 0 and isWalkable(toPosition, true, true, true) then
- if isSightClear(getThingPos(cid), toPosition, true) then
- doTeleportThing(cid, toPosition)
- doSendDistanceShoot(getThingPos(cid), toPosition, 28)
- else
- doPlayerSendCancel(cid, "Sorry, not possible.")
- end
- else
- doPlayerSendCancel(cid, "Sorry, not possible.")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment