Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. local function hasTile(pos)
  2. pos.stackpos = 0
  3. return getTileThingByPos(pos).itemid >= 1
  4. end
  5.  
  6. local function checkPos(pos)
  7. return hasTile(pos) and not getTileInfo(pos).house and isWalkable(pos, false, false, true, true)
  8. end
  9.  
  10. --isWalkable(pos, creature, proj, pz, water)
  11.  
  12. function onSay(cid, words, param)
  13. if getTileInfo(getThingPos(cid)).house or getTileInfo(getThingPos(cid)).protection then
  14. return doPlayerSendTextMessage(cid, 27, "You can't use this command inside of pz or house!")
  15. end
  16. local andares = 1
  17.  
  18. local pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 1)
  19. if hasTile(pos) then
  20. pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 2)
  21. end
  22.  
  23. if not hasTile(pos) then --descida
  24. repeat
  25. pos.z = pos.z+1
  26. if pos.z > 7 then
  27. doPlayerSendTextMessage(cid, 27, "You can't do that here!")
  28. return true
  29. end
  30. if checkPos(pos) then
  31. doTeleportThing(cid, pos, false)
  32. doSendAnimatedText(getCreaturePosition(cid), "Jump", 129)
  33. doSendMagicEffect(pos, 21)
  34. return true
  35. end
  36. andares = andares+1
  37. until pos.z > 7
  38.  
  39. doPlayerSendTextMessage(cid, 27, "You can't do that here!")
  40. return true
  41. end
  42.  
  43. pos = getPositionByDirection(getThingPos(cid), getCreatureLookDir(cid), 1)
  44. if isWalkable(pos) then
  45. return doPlayerSendTextMessage(cid, 27, "You need to be in front a wall or above a roof!")
  46. end
  47.  
  48. repeat
  49. pos.z = pos.z-1
  50. if checkPos(pos) then
  51. doTeleportThing(cid, pos, false)
  52. doSendAnimatedText(getCreaturePosition(cid), "Jump", 129)
  53. doSendMagicEffect(pos, 21)
  54. return true
  55. end
  56. andares = andares+1
  57. until pos.z < 0
  58. doPlayerSendTextMessage(cid, 27, "You can't do that here!")
  59. return true
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement