Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isInArea(pos, area)
- if pos.x >= area.fromx and pos.x <= area.tox then
- if pos.y >= area.fromy and pos.y <= area.toy then
- if pos.z >= area.fromz and pos.z <= area.toz then
- return true
- end
- end
- end
- return false
- end
- local templePos = {x = 1094, y = 1016, z = 7} -- This is the Free account temple position
- local townAreas = {
- {fromx=1092, fromy=1022, fromz=7, tox=1097, toy=1026, toz=7}, -- LOCALIZACAO 1
- {fromx=770, fromy=366, fromz=5, tox=910, toy=733, toz=8} -- Localizacao 2
- }
- function onLogin(cid)
- for _, area in ipairs(townAreas) do
- if isInArea(getPlayerPosition(cid), area) then
- doTeleportThing(cid, templePos)
- doPlayerSendTextMessage(cid, 24, "Você foi teleportado por motivos de
- segurança.")
- break
- end
- end
- return TRUE
- end
- ___________________________________________________
- registerCreatureEvent(cid, "tpcastle")
- ____________________________________________________
- <event type="login" name="tpcastle" script="tpcastle.lua"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement