Ir para conteúdo

Posts Recomendados

Ae galera, e tipow assim eu tenho um script de afk igual akele do refugia, so que eu quero coloca um "exhausted" nele, pq o player pod fla 100x afk, ai as mensagem fikam descontroladas saindo toda hora. Queria que alguem me ajudase a coloca um exhausted nisso, tipow so pod fla afk dinovo quando andar. O SCRIPT QUE UM CARA RESOLVEu ANTES NAO DEU CERTO, PESSO QUE NAO FEXEM O TOPICO SEM EU AUTORIZAR! O script e esse:

 

local FRASES = {"JÁ VOLTO!", "VOLTO JÁ!", "AUSENTE!", "AFK!", "OFF-LINE!", "NÃO TO!"} -- Auto-Mensagens.

local TEMPO = 2 -- Intervalo de Tempo em segundos.

 

local function doSendAutoMessage(cid, pos)

if (isCreature(cid) == TRUE) then

npos = getThingPos(cid)

if (pos.x == npos.x) and (pos.y == npos.y) and (pos.z == npos.z) then

doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)

doSendMagicEffect(pos, 2)

addEvent(doSendAutoMessage, TEMPO*1000, cid, npos)

end

end

end

 

function onSay(cid, words, param)

pos = getThingPos(cid)

doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)

doSendMagicEffect(pos, 2)

doPlayerSendCancel(cid, "AFK ligado!")

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "AFK ligado!.")

addEvent(doSendAutoMessage, TEMPO*1000, cid, pos)

return TRUE

end

 

fis so 1 modificaçao atoa que e

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "AFK ligado!.")

Se achar que deve tirar pod tirar. Me ajudem ae plz!

Editado por kakareco
Link para o comentário
https://xtibia.com/forum/topic/122274-exhausted-no-script-de-afk/
Compartilhar em outros sites

local FRASES = {"JÁ VOLTO!", "VOLTO JÁ!", "AUSENTE!", "AFK!", "OFF-LINE!", "NÃO TO!"} -- Auto-Mensagens.
local TEMPO = 2 -- Intervalo de Tempo em segundos.

local function doSendAutoMessage(cid, pos)
if (isCreature(cid) == TRUE) then
    npos = getThingPos(cid)
if (pos.x == npos.x) and (pos.y == npos.y) and (pos.z == npos.z) then
    doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
    doSendMagicEffect(pos, 2)
    q = addEvent(doSendAutoMessage, TEMPO*1000, cid, npos)
end
end
end

function onSay(cid, words, param)
pos = getThingPos(cid)
if getPlayerStorageValue(cid, STORAGE) == -1 then
    doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
    doSendMagicEffect(pos, 2)
    doPlayerSendCancel(cid, "AFK ligado!")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "AFK ligado!.")
    q = addEvent(doSendAutoMessage, TEMPO*1000, cid, pos)
    setPlayerStorageValue(cid, 1)
else
    doPlayerSendCancel(cid, "Você deve desligar o AFK antes.")
end
return TRUE
end

 

Pra desligar:

function onSay()
   if stopEvent(q) then
       return true
   end
   return true
end

 

Faz uma talk com a tag parecida com a desse aí.

 

Em data/creaturescripts/scripts cria o arquivo afk.lua e coloca:

function onLogout()
   if stopEvent(q) then
      return true
   else
      return true
   end
return true
end

 

Em data/creaturescripts/creaturescripts.xml:

<event type="logout" name="logout" event="script" value="afk.lua"/>

 

blsvlwflw

Link para o comentário
https://xtibia.com/forum/topic/122274-exhausted-no-script-de-afk/#findComment-805981
Compartilhar em outros sites

local FRASES = {"JÁ VOLTO!", "VOLTO JÁ!", "AUSENTE!", "AFK!", "OFF-LINE!", "NÃO TO!"} -- Auto-Mensagens.
local TEMPO = 2 -- Intervalo de Tempo em segundos.

local function doSendAutoMessage(cid, pos)
if (isCreature(cid) == TRUE) then
    npos = getThingPos(cid)
if (pos.x == npos.x) and (pos.y == npos.y) and (pos.z == npos.z) then
    doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
    doSendMagicEffect(pos, 2)
    q = addEvent(doSendAutoMessage, TEMPO*1000, cid, npos)
end
end
end

function onSay(cid, words, param)
pos = getThingPos(cid)
if getPlayerStorageValue(cid, STORAGE) == -1 then
    doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
    doSendMagicEffect(pos, 2)
    doPlayerSendCancel(cid, "AFK ligado!")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "AFK ligado!.")
    q = addEvent(doSendAutoMessage, TEMPO*1000, cid, pos)
    setPlayerStorageValue(cid, 1)
else
    doPlayerSendCancel(cid, "Você deve desligar o AFK antes.")
end
return TRUE
end

 

Pra desligar:

function onSay()
   if stopEvent(q) then
       return true
   end
   return true
end

 

Faz uma talk com a tag parecida com a desse aí.

 

Em data/creaturescripts/scripts cria o arquivo afk.lua e coloca:

function onLogout()
   if stopEvent(q) then
      return true
   else
      return true
   end
return true
end

 

Em data/creaturescripts/creaturescripts.xml:

<event type="logout" name="logout" event="script" value="afk.lua"/>

 

blsvlwflw

 

Esplica ai pelo amor de DEUS!

 

Link para o comentário
https://xtibia.com/forum/topic/122274-exhausted-no-script-de-afk/#findComment-806012
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...