Advertisement
Guest User

tpcastle

a guest
May 22nd, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function isInArea(pos, area)
  2. if pos.x >= area.fromx and pos.x <= area.tox then
  3. if pos.y >= area.fromy and pos.y <= area.toy then
  4. if pos.z >= area.fromz and pos.z <= area.toz then
  5. return true
  6. end
  7. end
  8. end
  9. return false
  10. end
  11.  
  12.  
  13. local templePos = {x = 1094, y = 1016, z = 7} -- This is the Free account temple position
  14.  
  15. local townAreas = {
  16. {fromx=1092, fromy=1022, fromz=7, tox=1097, toy=1026, toz=7}, -- LOCALIZACAO 1
  17. {fromx=770, fromy=366, fromz=5, tox=910, toy=733, toz=8} -- Localizacao 2
  18. }
  19.  
  20. function onLogin(cid)
  21. for _, area in ipairs(townAreas) do
  22. if isInArea(getPlayerPosition(cid), area) then
  23. doTeleportThing(cid, templePos)
  24. doPlayerSendTextMessage(cid, 24, "Você foi teleportado por motivos de
  25.  
  26. segurança.")
  27. break
  28. end
  29. end
  30. return TRUE
  31. end
  32.  
  33.  
  34.  
  35. ___________________________________________________
  36.  
  37. registerCreatureEvent(cid, "tpcastle")
  38.  
  39. ____________________________________________________
  40.  
  41.  
  42. <event type="login" name="tpcastle" script="tpcastle.lua"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement