editei o talk do Jhon992... testa esse dai ... !
function removeTp(lugardele)
doRemoveItem(getThingfromPos(lugardele).uid, 1)
end
function onSay(cid, words, param)
local config = {
exhaustionInSeconds = 30, -- exausted em segundos.
storage = 34534,
pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no").
battle = "yes", -- players deve estar sem battle ("yes" or "no")
custo = "no", -- se os teleport irão custa ("yes" or "no")
premium = "no" -- se precisa ser premium account ("yes" or "no")
}
-------------Config Lugares----------------
local lugar = {
[""] = {fromx="1121" fromy="452" fromz="7" tox="1244" toy="548" }, 50, 2000}, -- fromx a tox= vai da posição x até a outra x aleatorio e assim por diante no y e no z
[""] = {{x=2577, y=2086, z=7}, 50, 2000}
}
local locais = {"", "", "", "", ""} -- coloque os nomes dos locais
local tpmath = lugar[locais[math.random(1, 5)]] -- não mexa!
local position = getPlayerPosition(cid) -- posição atual do player, não mexa!
local tempo = 60 -- tempo e segundos para o teleport sumir
-------------/Config Checkar não mecha----------------
local lugar = lugar[param]
if (param == "check") then
for name, pos in pairs(lugar) do
text = "Destination: "..name..", Level required: "..pos[2]..","
if(config.battle == "yes") then
text = text.." Sorry, you are in battle."
else
text = text.." You can use while fighting: No"
end
if(config.pz == "yes") then
text = text.." You should use in protection zone: Yes"
else
text = text.." You should use in protection zone: No"
end
if (pos[3] == TRUE) then
text = text..", Cost: "..pos[4]..";"
end
doPlayerSendTextMessage(cid, 20, ""..text.."")
end
return TRUE
end
if(exhaustion.check(cid, config.storage) == TRUE) then
if (exhaustion.get(cid, 34534) >= 60) then
doPlayerSendCancel(cid, "You can only teleport after [" .. math.floor(exhaustion.get(cid, 34534) / 60 + 1) .."] minutes.")
end
if (exhaustion.get(cid, 34534) <= 60) then
doPlayerSendCancel(cid, "You can only teleport after [" .. exhaustion.get(cid, 34534).."] seconds.")
end
return TRUE
end
if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You should be in the protection zone for use.")
return TRUE
end
if(config.premium == "yes") and (not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.")
return TRUE
end
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not use in battle.")
return TRUE
end
if lugar ~= nil then
if not(lugar) then
doPlayerSendTextMessage(cid, 22, "Sorry, this place does not exist.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if (getPlayerLevel(cid) <= lugar[2]) then
doPlayerSendTextMessage(cid, 22, "Sorry, you don't have level. You need "..lugar[2].." level or more to be teleported.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if(config.custo == "no") and (doPlayerRemoveMoney(cid, lugar[3]) == FALSE) then
doPlayerSendTextMessage(cid, 22, "Sorry, you do not have enough money. You need "..lugar[3].." zenis to be teleported.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
end
if (param == "") then
doCreateTeleport(1387, tpmath[1], {x=position.x+1, y=position.y, z=position.z})
lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}
doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tempo*1000, lugardele)
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
return TRUE
end
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doCreateTeleport(1387, lugar[1], {x=position.x+1, y=position.y, z=position.z})
lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}
doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tempo*1000, lugardele)
return TRUE
end
modifiquei umas pequenas coisas no talkaction do Jhon992 .. testa ai e me fala
no fromx= tu poe da coordenada , por exemplo 25... tox até a coordenada 150
no fromy ... mesma coisa de cima
no fromz tu poe da coordenada 7 a tox 7...mas se for aleatorio vai poder cair em lugares q nao pode andar..tipo meio do mar !