function onSay(cid, words, param, channel)
local exhaust = 30
local storage = 9393
local destinations = {
["temple"] = {p = {x=31521, y=31523, z=7}, l = 10, c = 100},
["trainers"] = {p = {x=32296, y=32224, z=15}, l = 10, c = 200},
["tps"] = {p = {x=32174, y=32209, z=7}, l = 10, c = 300}
}
local tp = destinations[param]
if(param == "") then
doPlayerSendCancel(cid, "Command param required.")
return true
elseif(getPlayerMoney(cid) < tp.c) then
doPlayerSendCancel(cid, "You do not have enough money.")
return true
elseif(getPlayerLevel(cid) < tp.l) then
doPlayerSendCancel(cid, "Your level is not high enough.")
return true
elseif (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendCancel(cid, "You are currently in a fight.")
return true
elseif getPlayerStorageValue(cid, storage) >= os.time() then
doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..getPlayerStorageValue(cid, storage) - os.time().." seconds.")
return true
end
doPlayerRemoveMoney(cid, tp.c)
doTeleportThing(cid, tp.p)
doSendMagicEffect(tp.p, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
setPlayerStorageValue(cid, storage, os.time()+exhaust)
return true
end
tbm fiz um teleport por talk mais avaçado,se vc quiser dar uma olhada:
http://www.xtibia.com/forum/topic/134593-talkaction-teleport-por-talk-para-vip/