Skymagnum

Untitled

May 5th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. --[[ Cliport Item 1.1
  2. Autor: Skymagnum/Skyforever
  3. You can post in other forums if you take credits :)
  4. ]]
  5.  
  6. function onUse(cid, item, fromPosition, itemEx, toPosition)
  7.  
  8.     local canPassAtWalls = false
  9.     local removeAtUse = true
  10.     local maxDist = 4
  11.  
  12.     if not isWalkable(toPosition, true, true, true) then
  13.          doPlayerSendCancel(cid, "Sorry, not possible.") return true
  14.     end
  15.  
  16.     if canPassAtWalls == false and not isSightClear(fromPosition, toPosition, true) then
  17.          doPlayerSendCancel(cid, "Sorry, you can't do it.") return true
  18.     end
  19.  
  20.     if getDistanceBetween(fromPosition, toPosition) > maxDist then
  21.          doPlayerSendCancel(cid, "Sorry, is too far.") return true
  22.     end
  23.  
  24.     doTeleportThing(cid, toPosition, false)
  25.     doSendDistanceShoot(fromPosition, toPosition, 30)
  26.  
  27.     if removeAtUse then
  28.          doRemoveItem(item.uid, 1)
  29.     end
  30.  
  31.     return true
  32. end
Advertisement
Add Comment
Please, Sign In to add comment