Ir para conteúdo

Featured Replies

Postado

Galera, eu queria a ajuda de vocês pra editar esse script. Ele funciona da seguinte forma: se o player ficar ausente sem se mexer etc por X minutos ele é levado ao templo>

Gostaria que ao inves de ser levado ao templo, ele deslogasse. no caso, fosse kikado.

Segue os codigos:



events1,events2= {},{}
local config = {tempo = 2,storage = 22220  }  
function onStepIn(cid, item, frompos, topos)
if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) <= 0 then
doPlayerSendTextMessage(cid, 22, "Você tem 2 minutos.")  
setPlayerStorageValue(cid, config.storage, 1)
events1[getPlayerGUID(cid)] = addEvent(setPlayerStorageValue, config.tempo*60*1000-1000, cid, config.storage, -1)  
events2[getPlayerGUID(cid)] = addEvent(doTeleportThing, config.tempo*60*1000-500, cid, getTownTemplePosition(getPlayerTown(cid)))  
end
return true
end  
function onStepOut(cid, item, frompos, topos)
if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) >= 1 then  
setPlayerStorageValue(cid, config.storage, -1)  
doPlayerSendTextMessage(cid, 23, "System kick off!")  
stopEvent(events1[getPlayerGUID(cid)])
stopEvent(events2[getPlayerGUID(cid)])
end
return true
end

Atenciosamente :
AdilsonHacker

Te ajudei? click em rep_up.png

Meus Trabalhos:


Bronson Server - By Adilson Hacker

 

 

 

 

 

 

 

 

 

 

 

 

 

Postado

@Adilson Hacker Você gostaria do Idle System é isso?

Vá em login.lua e coloque isto antes do ultimo return true

Spoiler

registerCreatureEvent(cid, "Idle")

Logo em seguida crie um arquivo .lua com o nome Idle e cole isto dentro:

Spoiler

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
 

E por ultimo coloque isto no creaturescripts.lua

Spoiler

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

Não esqueça de conferir se o seu servidor ja tem o sistema para não duplica-lo

VlVKQKC.png&key=d5c17620ae9567a1f898dd7a

 

 

 

  • 532144234_Logo_NTO_BLOOD_Finish_HIM_By_Antonio_Luckas(3).png.fd58d1af125a7e82ccdd751637e9ca93.png

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo