Acho que nao preciso muito dizer o que quero , queria uma Talkaction que quando eu usasse ela iria me teleportar para a house que esta no meu nome.
Tenho 1 script que peguei aqui no XTibia vou postar ele aqui para que voces possam colocar o !teleport house junto a ele para facilitar.
function onSay(cid, words, param)
local config = {
vip = "no", -- somente vip players poderam usar o comando? ("yes" or "no")
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")
storage = 13540, -- Storage Id da sua vip account caso for usar somente vips
premium = "yes", -- se precisa ser premium account ("yes" or "no")
Need = "yes", -- se precisa de item para usar ("yes" or "no")
Item = 9742 -- ID do seu item
}
-------------Config Lugares----------------
local lugar = {
["depot"] = {{x=160, y=54, z=7}, 1, 2000},
["3k area"] = {{x=365, y=458, z=4}, 10, 1000},
["quest"] = {{x=271, y=326, z=14}, 8, 1000},
["arena"] = {{x=159, y=120, z=7}, 8, 1000},
["trainers"] = {{x=104, y=28, z=14}, 8, 1000},
["shop"] = {{x=148, y=32, z=8}, 14, 1000},
["bosses"] = {{x=324, y=364, z=1}, 10, 1000}
}
-------------/Config Checkar não mecha----------------
local lugares = lugar[param]
if (param == "check") then
for name, pos in pairs(lugar) do
text = "Destino: "..name..", Level necessario: "..pos[2]..","
if(config.battle == "yes") then
text = text.." Voce pode usar estando battler: NÃO"
else
text = text.." Voce pode usar estando battler: SIM"
end
if(config.pz == "yes") then
text = text.." Voce DeVe Usar estando PZ: SIM"
else
text = text.." Voce DeVe 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
--[[ Lista de Viagem (Não mexa) ]]--
if (param == "list") 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
if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")
return TRUE
end
if(config.premium == "yes") and (not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can teleport.")
return TRUE
end
if (config.vip == "yes") and getPlayerStorageValue(cid, tonumber(config.storage)) - os.time() <= 0 then
doPlayerSendCancel(cid,"Você não possui vip.")
return TRUE
end
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You need without pz for teleport.")
return TRUE
end
if not(lugares) then
doPlayerSendTextMessage(cid, 22, "Sorry, this place does not exist.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if (getPlayerLevel(cid) <= lugares[2]) then
doPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..lugares[2].." level ou mais para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
if (config.Need == "yes") and getPlayerItemCount(cid,config.Item) < 1 then
doPlayerSendCancel(cid,"You no have a item " .. getItemNameById(config.Item) .. ".")
return TRUE
end
if(config.custo == "yes") and (doPlayerRemoveMoney(cid, lugares[3]) == FALSE) then
doPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..lugares[3].." gp para ser teleportado.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end
doTeleportThing(cid, lugares[1])
doSendMagicEffect(lugares[1], CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " It was teleported: \n " .. param .. ".")
return TRUE
end