Postado Abril 17, 2020 5 anos Diretor Tenta esse local configs = { players_db = {}, save_delay = 5, -- Segundos } function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) return addEvent(savePlayer, configs.save_delay * 1000) end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Abril 17, 2020 5 anos @Magalhaes92 local configs = { players_db = {}, save_delay = 5, -- Segundos } function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) addEvent(function() if isCreature(configs.players_db[1]) then savePlayer() end end, configs.save_delay * 1000) end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end
Postado Abril 17, 2020 5 anos Autor Em 17/04/2020 em 11:17, L3K0T disse: Tenta esse local configs = { players_db = {}, save_delay = 5, -- Segundos } function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) return addEvent(savePlayer, configs.save_delay * 1000) end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end Nao da error algum, porem nao salva =[ Em 17/04/2020 em 17:00, Storm disse: @Magalhaes92 local configs = { players_db = {}, save_delay = 5, -- Segundos } function savePlayer() if #configs.players_db > 0 then doPlayerSave(configs.players_db[1]) table.remove(configs.players_db, 1) addEvent(function() if isCreature(configs.players_db[1]) then savePlayer() end end, configs.save_delay * 1000) end return true end function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do table.insert(configs.players_db, cid) end savePlayer() return true end Funcionou Perfeitamente Amigo. Sem ERROS e SALVANDO !!!
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.