Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Bom dia galera, É seguinte no meu serve se o player de exit nos trainers ele fica la ate o serve ser reiniciado, já tentei mexer no  idleWarningTime, idleKickTime e não esta funcionando , ja tentei tbm mexer no tile dos trainers e tbm nada, Queria algo que kick o player em qualquer lugar do serve se ele ficar 15 sem se mexer alguém pode ajudar?

 

idleWarningTime = 10 * 60 * 1000
idleKickTime = 15 * 60 * 1000

Editado por phuzil (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Em creaturescripts > creaturescript.xml adiciona isso:

 

 

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

 

 

Agora em creaturescripts > scripts > idle apague tudo oque está lá e coloca isso:

 

 

 

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

 

 

 

 

Agora em Creaturescripts > Scripts > login.lua adiciona essa tag:

 

 

 

 

registerCreatureEvent(cid, "Idle")

 

 

 

 

 

Pra você alterar o tempo do exit basta abrir o config.lua e configura-lo nessa parte aqui:

 

 

 

 

 

idleWarningTime = 9 * 60 * 1000
idleKickTime = 10 * 60 * 1000

Link para o post
Compartilhar em outros sites

Em que parte do login eu coloco o registerCreatureEvent(cid, "Idle")?

 

 

function onLogin(cid)
accountManager = "Account Manager"                       
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then             
      managerCounter = managerCounter + 1
      end
   end
 
   if managerCounter >= 3 then
      return false
   end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid,100000) == 1 then
        doPlayerSetTown(cid, 2)
        setPlayerStorageValue(cid,100000,2)
        doTeleportThing(cid,{x=72, y=25, z=8})
        doPlayerPopupFYI(cid, "Your premium time has expired and you've been teleported to Main Land. You're now alived to Deheon.")
        if getPlayerSex(cid) == 1 then
            doCreatureChangeOutfit(cid,{lookType = 128, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
        elseif getPlayerSex(cid) ~= 1 then
            doCreatureChangeOutfit(cid,{lookType = 136, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
        end
    end


    if(not isPlayerGhost(cid)) and (isVip(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
    elseif(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    local lastLogin, str = getPlayerLastLoginSaved(cid)
        
    if(lastLogin >= 0) then
        str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
    else
        str = str .. " Please choose your outfit."
        doPlayerSendOutfitWindow(cid)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    registerCreatureEvent(cid, "TempleTeleporter") --VIP
    registerCreatureEvent(cid, "VipCheck") --VIP

    registerCreatureEvent(cid, "advance")
    registerCreatureEvent(cid, "bp")
    registerCreatureEvent(cid, "Achievements")
    registerCreatureEvent(cid, "fullmh")
        registerCreatureEvent(cid, "expvip")
    registerCreatureEvent(cid, "primeiro")
    registerCreatureEvent(cid, "killcount")
    registerCreatureEvent(cid, "playeradvance")
    registerCreatureEvent(cid, "radvance")
    registerCreatureEvent(cid, "counter")

    registerCreatureEvent(cid, "Grizzly_Adams")

    registerCreatureEvent(cid, "demonOakLogout")
    registerCreatureEvent(cid, "demonOakDeath")
    registerCreatureEvent(cid, "demonOakAttack")

    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "Idle")
    registerCreatureEvent(cid, "SkullCheck")

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "Zaoarena")
    registerCreatureEvent(cid, "ArenaKill")

    registerCreatureEvent(cid, "Tirecz")

    registerCreatureEvent(cid, "Inquisition")  
    registerCreatureEvent(cid, "inquisitionPortals")
    registerCreatureEvent(cid, "arenaPortals")
 







 -- first login ~ Outfit Windows
    if getPlayerStorageValue(cid, 1228512) == -1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")
        doPlayerSendOutfitWindow(cid)
         setPlayerStorageValue(cid,1228512, 1)
    end
    
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
        
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
    return true
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