Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function hasTile(pos)
- pos.stackpos = 0
- return getTileThingByPos(pos).itemid >= 1
- end
- local function checkPos(pos)
- return hasTile(pos) and not getTileInfo(pos).house and isWalkable(pos, false, false, true, true)
- end
- --isWalkable(pos, creature, proj, pz, water)
- function onSay(cid, words, param)
- if getTileInfo(getThingPos(cid)).house or getTileInfo(getThingPos(cid)).protection then
- return doPlayerSendTextMessage(cid, 27, "You can't use this command inside of pz or house!")
- end
- local andares = 1
- local pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 1)
- if hasTile(pos) then
- pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 2)
- end
- if not hasTile(pos) then --descida
- repeat
- pos.z = pos.z+1
- if pos.z > 7 then
- doPlayerSendTextMessage(cid, 27, "You can't do that here!")
- return true
- end
- if checkPos(pos) then
- doTeleportThing(cid, pos, false)
- doSendAnimatedText(getCreaturePosition(cid), "Jump", 129)
- doSendMagicEffect(pos, 21)
- return true
- end
- andares = andares+1
- until pos.z > 7
- doPlayerSendTextMessage(cid, 27, "You can't do that here!")
- return true
- end
- pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 1)
- if isWalkable(pos) then
- return doPlayerSendTextMessage(cid, 27, "You need to be in front a wall or above a roof!")
- end
- repeat
- pos.z = pos.z-1
- if checkPos(pos) then
- doTeleportThing(cid, pos, false)
- doSendAnimatedText(getCreaturePosition(cid), "Jump", 129)
- doSendMagicEffect(pos, 21)
- return true
- end
- andares = andares+1
- until pos.z < 0
- doPlayerSendTextMessage(cid, 27, "You can't do that here!")
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement