Ir para conteúdo

Featured Replies

Postado

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?

Resolvido por ViitinG

Ir para solução
  • Respostas 6
  • Visualizações 797
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • "data/creaturescripts/creaturescripts.xml" : <event type="think" name="Idle" event="script" value="idle.lua"/> "data/creaturescripts/scripts/idle.lua" : local config = { idleWarning = getCo

Postado
  • 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. ^^

Postado

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)

 

 

Postado
  • Autor

 

"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é?

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo