Ir para conteúdo
  • Cadastre-se

(Resolvido)Logout


Ir para solução Resolvido por ViitinG,

Posts Recomendados

Olá.

 

Bom, mesmo o Lua estando configurado corretamente:

 

idleWarningTime = 14 * 60 * 1000
idleKickTime = 15 * 60 * 1000
 
O char fica logado por minutos, ou até horas.
 
Aonde devo mudar para que o char obedeça esse kicktime?
Link para o post
Compartilhar em outros sites
  • Solução

"data/creaturescripts/creaturescripts.xml" :

<event type="think" name="Idle" event="script" value="idle.lua"/>

"data/creaturescripts/scripts/idle.lua" :

local config = {
idleWarning = getConfigValue('idleWarningTime'),
idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then
return true
end

local idleTime = getPlayerIdleTime(cid) + interval
doPlayerSetIdleTime(cid, idleTime)
if(config.idleKick > 0 and idleTime > config.idleKick) then
doRemoveCreature(cid)
elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
if(config.idleKick > 0) then
message = message .. ", you will be disconnected in "
local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
if(diff > 1) then
message = message .. diff .. " minutes"
else
message = message .. "one minute"
end

message = message .. " if you are still idle"
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
end

return true
end

"data/creaturescripts/login.lua" :

registerCreatureEvent(cid, "Idle")

Agora é só alterar o tempo no neste local que você citou do config.lua. ^^

Link para o post
Compartilhar em outros sites

se ainda assim nao funcionar faz assim nessa parte troque isso:

 

local config = {
idleWarning = getConfigValue('idleWarningTime'),
idleKick = getConfigValue('idleKickTime')
}

 

por isso:

 

local config = {
idleWarning = 840000,
idleKick = 900000
}
 
e pronto, vai funcionar 100%
Editado por AnaPaula (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

 

"data/creaturescripts/creaturescripts.xml" :

<event type="think" name="Idle" event="script" value="idle.lua"/>

"data/creaturescripts/scripts/idle.lua" :

local config = {

idleWarning = getConfigValue('idleWarningTime'),

idleKick = getConfigValue('idleKickTime')

}

function onThink(cid, interval)

if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or

getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then

return true

end

local idleTime = getPlayerIdleTime(cid) + interval

doPlayerSetIdleTime(cid, idleTime)

if(config.idleKick > 0 and idleTime > config.idleKick) then

doRemoveCreature(cid)

elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then

local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"

if(config.idleKick > 0) then

message = message .. ", you will be disconnected in "

local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)

if(diff > 1) then

message = message .. diff .. " minutes"

else

message = message .. "one minute"

end

message = message .. " if you are still idle"

end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")

end

return true

end

"data/creaturescripts/login.lua" :

registerCreatureEvent(cid, "Idle")

 

Esse script não tem aquele bug comum no idle que  não deixar os jogadores sair do jogo quando atacam um monstro não né?

Link para o post
Compartilhar em outros sites

Jaja te respondo.

 

Olha, no /reload não deu efeito.

Tem que desligar o servidor?

 

 

Deu sim, apareceu aviso aqui, e logo após deslogou :D

Vlw vlw, solucionado ViitinG.

Editado por hadamais (veja o histórico de edições)
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