EL
pedido

!go talkaction

Por EliteSilyx, 15 de fev. de 2013 em Scripts

resolvido
16
1.4k
LucasyeahL
18 de fevereiro de 2013 às 15:32

Obrigado, coloquei assim ..

 

function onSay(cid, words, param)
local config = {
pz = false, -- players precisam estar em protection zone para usar? (true or false)
battle = true, -- players deve estar sem battle (true or false)
custo = true, -- se os teleport irão custa (true or false)
need_level = true, -- se os teleport irão precisar de level (true or false)
premium = true, -- se precisa ser premium account (true or false)
s = 11548, -- n mexa
exhau = 10 -- tempo em seegundos para salvar denovo
}
--[[ Config lugares]]--
local lugar = {
["templo"] = { -- nome do lugar
pos = {x = 7999, y = 7992, z = 7},level = 10, price = 000},
["arena"] = { -- nome do lugar
pos = {x=24900, y=24965, z=7},level = 15,price = 000},
["tps"] = { -- nome do lugar
pos = {x=24992, y=24829, z=5},level = 15,price = 000},
["vip"] = { -- nome do lugar
pos = {x=25089, y=25362, z=7},level = 15,price = 000},
["treiner"] = { -- nome do lugar
pos = {x=24999, y=25383, z=6},level = 15,price = 000},
["quests"] = { -- nome do lugar
pos = {x=25024, y=24852, z=7},level = 15,price = 000},
}
--[[ Lista de Viagem (Não mexa) ]]--
if (param == "lista") then
local str = ""
str = str .. "lista de viagem :\n\n"
for name, pos in pairs(lugar) do
str = str..name.."\n"
end
str = str .. ""
doShowTextDialog(cid, 6579, str)
return TRUE
end
local a = lugar[param]
if not(a) then
doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")
return TRUE
elseif config.premium == true and not isPremium(cid) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.")
return TRUE
elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")
return TRUE
elseif config.need_level == true and getPlayerLevel(cid) < a.level then
doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then
doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
elseif getPlayerStorageValue(cid, config.s) > os.time() then
doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar o comando novamente.")
return TRUE
end
setPlayerStorageValue(cid, config.s, config.exhau + os.time())
doTeleportThing(cid, a.pos)
doSendMagicEffect(a.pos, CONST_ME_TELEPORT)
doBroadcastMessage("" .. getPlayerName(cid) .. " foi teleportado para: " .. param .. ".Usando /fly", 25)
return TRUE
end

 

Só pra constar esse sistema de fly é usado para o perfectvip system do Vodkart ;D

Quem precisar usa ae :)

REP+ Sky~