local destinations = {
["temple"] = {pos = {x = 1111, y = 1111, z = 7}, cost = 1000},
["boat"] = {pos = {x = 2222, y = 2222, z = 6}, cost = 2000}
}
function onSay(cid, words, param, channel)
local tp = destinations[param]
if(param == "") then
return doPlayerSendCancel(cid, "Command param required.")
end
if(getPlayerMoney(cid) < tp.cost) then
return doPlayerSendCancel(cid, "You do not have enough money.")
elseif(isPlayerPzLocked(cid) == true) then
return doPlayerSendCancel(cid, "You are currently in a fight.")
elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
return doPlayerSendCancel(cid, "You are currently in a fight.")
elseif getPlayerLevel(cid) < 50 then
return doPlayerSendCancel(cid, "You dont have level.")
else
doPlayerRemoveMoney(cid, tp.cost)
doTeleportThing(cid, tp.pos)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
end
return true
end