Postado Dezembro 10, 2018 6 anos Alguém passa esse mods para globalevents e que o sorteio seja randômico com quantia minima e máxima por favor? Obrigado desde já, rep+ para quem ajudar. Loterry <Mods> Spoiler <mod name="Lottery System" version="1.5" author="Absolute" contact="[email protected]" enabled="yes"> <config name="lottery_config"><![CDATA[ config = { lottery_hour = "2 hour", -- Time to next lottery (only for broadcast message, real time you can set on globalevents.xml) rewards_id = {2160}, {2346}, {7443}, {11390}, -- Rewards ID crystal_counts = 10, -- Used only if on rewards_id is crystal coin (ID: 2160). website = "no" -- Only if you have php scripts and table `lottery` in your database! } ]]></config> <globalevent name="lottery" interval="3600000" event="script"><![CDATA[ domodlib('lottery_config') function onThink(interval, lastExecution) if(getWorldCreatures(0) == 0)then return true end local list = {} for i, tid in ipairs(getPlayersOnline()) do list = tid end local winner = list[math.random(1, #list)] local random_item = config.rewards_id[math.random(1, #config.rewards_id)] if(random_item == 2160) then doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[Loteria Automatica] " .. getCreatureName(winner) .. ", Ganhou: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Parabens! (Proximo sorteio em " .. config.lottery_hour .. ")") else doBroadcastMessage("[Loteria Automatica] " .. getCreatureName(winner) .. ", Ganhou: " .. getItemNameById(random_item) .. "! Parabens (Proximo sorteio em " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');") end return true end ]]></globalevent> </mod> Meu Curso sobre Programação para OTServer Programando OTServer Peça o seu script! Entre agora mesmo no grupo Developing Conteúdos: Spoiler • Cidade [8.60] • Cave de Boss • Widget Gesior • Autoloot 100% • [Old Client] Como Hookar Dll • Configurando VPS Windowns • [Solução] Código Caracteres Especiais Discord: Belmont#7352 Não esqueça do REP+
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.