1579091 109 Postado Julho 30, 2012 Share Postado Julho 30, 2012 Gostaria que pudesse também da /t o nome da cidade: /t carlin <- te teleportava pra carlin /t edron <- te teleportava pra edron... se tiver como ajudar!! VLW +REP function onSay(cid, words, param, channel) local tid = cid if(param ~= '') then tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end end local pos = getPlayerTown(tid) local tmp = getTownName(pos) if(not tmp) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.") return true end pos = getTownTemplePosition(pos) if(not pos or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".") return true end pos = getClosestFreeTile(tid, pos) if(not pos or isInArray({pos.x, pos.y}, 0)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.") return true end tmp = getCreaturePosition(tid) if(doTeleportThing(tid, pos, true) and not isPlayerGhost(tid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(pos, CONST_ME_TELEPORT) end return true end Link para o comentário https://xtibia.com/forum/topic/190884-comando-t/ Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 30, 2012 Share Postado Julho 30, 2012 (editado) vai em data/talkactions/script crie 1 arquivo com nome teleport.lua e cole isso. --[[script By Vodkart]]-- function onSay(cid, words, param) local config = { pz = true, -- 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) } --[[ Config lugares]]-- local lugar = { ["carlin"] = { -- nome do lugar pos = {x=129, y=54, z=6},level = 5,price = 1000}, ["venore"] = { -- nome do lugar pos = {x=160, y=54, z=7},level = 10, price = 2000}, ["thais"] = { -- nome do lugar pos = {x=125, y=351, z=9},level = 15,price = 3000}, ["edron"] ={ -- nome do lugar pos = {x=280, y=87, z=4},level = 20,price = 4000} } --[[ 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 end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE end em talkactions.xml adicione <talkaction words="!t" script="teleport=.lua"/> edit as pos. se quiser e so adc mais. para usar e so falar. !t local. Editado Julho 30, 2012 por Tchubaka Link para o comentário https://xtibia.com/forum/topic/190884-comando-t/#findComment-1305016 Compartilhar em outros sites More sharing options...
0 1579091 109 Postado Julho 30, 2012 Autor Share Postado Julho 30, 2012 Além de não ter funcionado, não era o que eu queria, gostaria que você editasse o comando que eu passei, e que apenas gods usassem... Link para o comentário https://xtibia.com/forum/topic/190884-comando-t/#findComment-1305207 Compartilhar em outros sites More sharing options...
0 1027929 23 Postado Julho 30, 2012 Share Postado Julho 30, 2012 Para por só pra GODs... <talkaction words="!t" script="teleport.lua"/> Mude para <talkaction log="yes" words="/t" access="5" event="script" value="teleport.lua"/> OBS: em teleport.lua mude para seu arquivo.lua Link para o comentário https://xtibia.com/forum/topic/190884-comando-t/#findComment-1305217 Compartilhar em outros sites More sharing options...
0 Tchubaka 36 Postado Julho 30, 2012 Share Postado Julho 30, 2012 mude <talkaction log="yes" words="!t" access="5" event="script" value="teleport.lua"/> lembrando vc edito aki.? --[[ Config lugares]]-- local lugar = { ["carlin"] = { -- nome do lugar pos = {x=129, y=54, z=6},level = 5,price = 0}, ["venore"] = { -- nome do lugar pos = {x=160, y=54, z=7},level = 10, price = 0}, ["thais"] = { -- nome do lugar pos = {x=125, y=351, z=9},level = 15,price = 0}, ["edron"] ={ -- nome do lugar pos = {x=280, y=87, z=4},level = 20,price = 0} } vai no god e da look no tile onde queira que ele va. e configura as pos. ai. Link para o comentário https://xtibia.com/forum/topic/190884-comando-t/#findComment-1305218 Compartilhar em outros sites More sharing options...
Pergunta
1579091 109
Gostaria que pudesse também da /t o nome da cidade:
/t carlin <- te teleportava pra carlin
/t edron <- te teleportava pra edron...
se tiver como ajudar!! VLW +REP
Link para o comentário
https://xtibia.com/forum/topic/190884-comando-t/Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados