Ir para conteúdo
  • Cadastre-se

(Resolvido)[Pedido] Sistema !debug que volta para a cidade incial do player.


Ir para solução Resolvido por Rusherzin,

Posts Recomendados

Oi pessoal queria um sistema !debug ele funciona assim, quando a pessoa ta bugada e quando o BATTLE DELA  ESTA SEM SER ATACADA ela dando !debug volta para sua cidade inicial. Mais Porfavor fazem um que só tem como voltar para a cidade se ela nao estiver sendo atacada, Caso Ela esteja sendo atacada vai aparecer uma mensagem [Voce nao pode desbugar enquanto estiver sendo atacado(a)]

 

E quando ela nao tiver sendo atacada e de !debug e voltar para sua city inicial vai aparecer uma mensagem "Voce foi desbugado(a)

Link para o post
Compartilhar em outros sites

Vai em talkaction.xml e criei a tag:

<talkaction words="!debug" access="1" script="debug"/>

Vai em talkaction > scripts e criei debug.lua:


function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
 doPlayerSendCancel(cid, 'Voce nao pode voltar para o templo se estiver com battle.')	
else
 pos = getTownTemplePosition(getPlayerTown(cid))
 doSendMagicEffect(getPlayerPosition(cid),53)
 doPlayerSendCancel(cid,"Teleportado!")
 doTeleportThing(cid,pos)
end

Não testei, mas quase certo que funciona. Abraço.

z_WL63_Tt.png

Link para o post
Compartilhar em outros sites

Data,  talkactions:

talkactions.xml

pesquise por players ( http://prntscr.com/4iqy7a ) e vá na ultima linha que tem coisa escrita [http://prntscr.com/4iqyzv(players)] e coloque 

 

<talkaction log="yes" words="/t" access="1" event="script" value="teleportmaster.lua"/>
 

 

dps va na pasta scripts e adicione o arquivo teleportmaster.lua

 

 

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

Editado por oiuhygwueuho (veja o histórico de edições)

Gente, não dou suporte via mp, caso queira ajuda crie um tópico no fórum!!!
youtube.png  10869_64x64.png
Ajudei? Clicar em gostar não vai te matar

Link para o post
Compartilhar em outros sites

Vai em talkaction.xml e criei a tag:

<talkaction words="!debug" access="1" script="debug"/>

Vai em talkaction > scripts e criei debug.lua:


function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
 doPlayerSendCancel(cid, 'Voce nao pode voltar para o templo se estiver com battle.')	
else
 pos = getTownTemplePosition(getPlayerTown(cid))
 doSendMagicEffect(getPlayerPosition(cid),53)
 doPlayerSendCancel(cid,"Teleportado!")
 doTeleportThing(cid,pos)
end

Não testei, mas quase certo que funciona. Abraço.

Man o seu não funfo..

 

[02/09/2014 20:36:07] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/debug.lua:10: 'end' expected (to close 'function' at line 1) near '<eof>'
[02/09/2014 20:36:07] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/debug.lua)
[02/09/2014 20:36:07] data/talkactions/scripts/debug.lua:10: 'end' expected (to close 'function' at line 1) near '<eof>'

Data,  talkactions:

talkactions.xml

pesquise por players ( http://prntscr.com/4iqy7a ) e vá na ultima linha que tem coisa escrita [http://prntscr.com/4iqyzv(players)] e coloque 

 

<talkaction log="yes" words="/t" access="1" event="script" value="teleportmaster.lua"/>
 

 

dps va na pasta scripts e adicione o arquivo teleportmaster.lua

 

 

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

 

Data,  talkactions:

talkactions.xml

pesquise por players ( http://prntscr.com/4iqy7a ) e vá na ultima linha que tem coisa escrita [http://prntscr.com/4iqyzv(players)] e coloque 

 

<talkaction log="yes" words="/t" access="1" event="script" value="teleportmaster.lua"/>
 

 

dps va na pasta scripts e adicione o arquivo teleportmaster.lua

 

 

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

 

Lek o seu funfo mais ele ta desbugando até mesmo sendo atacado e não quero assim.. se o player tiver com battle [alguem atacando ele] ele não vai poder desbugar só quando ele tiver sem o battle ativo

Link para o post
Compartilhar em outros sites
  • Solução
function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
 doPlayerSendCancel(cid, 'Voce nao pode voltar para o templo se estiver com battle.')	
else
 pos = getTownTemplePosition(getPlayerTown(cid))
 doSendMagicEffect(getPlayerPosition(cid),53)
 doPlayerSendCancel(cid,"Teleportado!")
 doTeleportThing(cid,pos)
end
end

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Link para o post
Compartilhar em outros sites

[RESOLVIDO] 

 

function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_INFIGHT) then
 doPlayerSendCancel(cid, 'Voce nao pode voltar para o templo se estiver com battle.')	
else
 pos = getTownTemplePosition(getPlayerTown(cid))
 doSendMagicEffect(getPlayerPosition(cid),53)
 doPlayerSendCancel(cid,"Teleportado!")
 doTeleportThing(cid,pos)
end
end
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo