Postado Dezembro 4, 2018 6 anos 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: Mostrar conteúdo oculto 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 :AdilsonHackerTe ajudei? click em Meus Trabalhos: Mostrar conteúdo oculto Bronson Server - By Adilson Hacker
Postado Dezembro 5, 2018 6 anos @Adilson Hacker Você gostaria do Idle System é isso? Vá em login.lua e coloque isto antes do ultimo return true Mostrar conteúdo oculto registerCreatureEvent(cid, "Idle") Logo em seguida crie um arquivo .lua com o nome Idle e cole isto dentro: Mostrar conteúdo oculto 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 Mostrar conteúdo oculto <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 Olá, que tal dar uma olhada no meu projeto? https://discord.gg/bsNkbsyJ3W
Postado Dezembro 5, 2018 6 anos Autor Não, mas já resolvi. Obrigado! Atenciosamente :AdilsonHackerTe ajudei? click em Meus Trabalhos: Mostrar conteúdo oculto Bronson Server - By Adilson Hacker
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.