Chilenox Moderador
Mensajes : 1 Fecha de inscripción : 13/09/2011
| Tema: [Mod] Lottery Sistem 13/9/2011, 5:22 pm | |
| Bueno, para comenzar doy creditos a Chojrak por el script. Bueno para comenzar ve a tu carpeta donde se hubica tu servidor y anda a MODS. luego ve a inicio y abre un bloc de notas y pon dentro lo siguiente: - Código:
-
<mod name="Lottery System" version="1.0" author="Chojrak" contact="chojrak@otland.net" enabled="no"> <config name="lottery"> <![CDATA[ config = { broadcast = true, rewards = { -- Item ID[, count] {2160, 5}, {5958, 1}, {2335, 1}, {2336, 1}, {2337, 1}, {2338, 1}, {2339, 1}, {2340, 1}, {5942, 1}, {5953, 1}, {6103, 1}, {8266, 1}, {5792, 1}, {2361, 1}, {6571, 1}, {2374, 1}, {6572, 1}, {2260, 10}, {3960, 1}, {5875, 1}, {5958, 1} } } ]]> </config> <globalevent name="lottery" interval="5400" event="script"> <![CDATA[ domodlib("lottery") function onThink(interval, lastExecution) local list = getPlayersOnline() if (#list == 0) then return true end
local winner = list[math.random(#list)] local item = config.rewards[math.random(#config.rewards)]
doPlayerAddItem(winner, item[1], item[2] or 1) if (config.broadcast) then doBroadcastMessage(".: Lottery System :.\nWinner: ".. getCreatureName(winner) .."\nReward: ".. getItemNameById(item[1]) .."\nNext lottery in ".. interval / 60 .." minutes.") end return true end ]]> </globalevent> </mod> y lo guardas en la carpeta de mods con el nombre de: lottery.xml Testeado en tfs 0.4 y 0.3.6, cualquier duda o consulta, pregunten. | |
|