function onSay(cid, words, param)
-------------Config----------------
local places = {
["depot"] = {{x=129, y=54, z=6}, 1, TRUE, 2000, FALSE},
["templo"] = {{x=160, y=54, z=7}, 10, TRUE, 20, FALSE},
["arena"] = {{x=162, y=54, z=7}, 10, TRUE, 20, FALSE},
["area vip"] = {{x=163, y=54, z=7}, 10, TRUE, 20, FALSE}
}
-------------/Config----------------
local place = places[param]
if (param == "check") then
for name, pos in pairs(places) do
text = "Destino: "..name..", Level necessario: "..pos[2]..","
if (pos[5] == TRUE) then
text = text.." Voce pode usar estando PZ: SIM"
else
text = text.." Voce pode usar estando PZ: Não"
end
if (pos[3] == TRUE) then
text = text..", Cost: "..pos[4]..";"
end
doPlayerSendTextMessage(cid, 20, ""..text.."")
end
return TRUE
end
if not(place) then
doPlayerSendTextMessage(cid, 22, "desculpe, você não pode teleportar para lá")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if (getPlayerLevel(cid) <= place[2]) then
doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..place[2].." level para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
doPlayerSendCancel(cid, "Você nao tem Vip account.")
return TRUE
end
if (place[5] == TRUE) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, 22, "Você nao pode ser Teleportado com PZ.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if (place[3] == TRUE) and (doPlayerRemoveMoney(cid, place[4]) == FALSE) then
doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..place[4].." gp para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
doTeleportThing(cid, place[1])
doSendMagicEffect(place[1], CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, 22, "Voce foi teleportado para \n "..param..".")
return TRUE
end