Postado Março 12, 2017 8 anos Mesmo eu colocando 1 que esta em horas, para minutos. action local config = { rate = 2, -- Rate que vai ficar o Scroll. time = 1, -- Tempo dado pelo Scroll. storage = 20011 } local function endExpRate(cid) if not isPlayer(cid) then return end doPlayerSetRate(cid, SKILL__LEVEL, 6.0) setPlayerStorageValue(cid, config.storage, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end function onUse(cid, item, fromPosition, itemEx, toPosition) local timeLeft = getPlayerStorageValue(cid, 20011) if timeLeft > os.time() then local timeTable = os.date('*t', timeLeft - (os.time() + 3600)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second")) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time)) doPlayerSetRate(cid, SKILL__LEVEL, config.rate) setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000) addEvent(endExpRate, config.time * 3600 * 1000, cid) doRemoveItem(item.uid, 1) return true end Editado Março 13, 2017 8 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Março 15, 2017 8 anos Autor up (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Março 15, 2017 8 anos eu não percebi bem a sua pergunta, mas calculo que quer trocar horas por minutos, certo? muda isto: setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000) addEvent(endExpRate, config.time * 3600 * 1000, cid) para: setPlayerStorageValue(cid, config.storage, os.time() + config.time * 1000) addEvent(endExpRate, config.time * 1000, cid)
Postado Março 15, 2017 8 anos Solução Em 15/03/2017 em 21:20, x1zy disse: eu não percebi bem a sua pergunta, mas calculo que quer trocar horas por minutos, certo? muda isto: setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000) addEvent(endExpRate, config.time * 3600 * 1000, cid) para: setPlayerStorageValue(cid, config.storage, os.time() + config.time * 1000) addEvent(endExpRate, config.time * 1000, cid) na vdd, se vc notar bem, vc está transformando 1 hora em 1 segundo, pois config.time(1) * 1000 = 1000ms = 1s Então o certo é deixar setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60 * 1000) addEvent(endExpRate, config.time * 60 * 1000, cid) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
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.