<?xml version="1.0" encoding="UTF-8"?>
<mod name="Lottery" enabled="yes">
<config name="lottery_config"><![CDATA[
t = {
lottery_hour = "45 Min", -- Time to next lottery (you set the real time on interval, it's only for the broadcast message.)
rewards_id = {2494, 2472, 2514, 2195, 2470, 2656, 7895, 2160}, -- ID's of rewards
stackable_amount = 20, -- amount, if this it's a stackable item
website = true -- Do you have `lottery` table in your database?
}
]]></config>
<globalevent name="lottery" interval="3600" event="buffer"><![CDATA[
domodlib('lottery_config')
local list = getPlayersOnline()
if #list > 0 then
local winner, item = list[math.random(#list)], t.rewards_id[math.random(#t.rewards_id)]
local stackable = getItemInfo(item).stackable
doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1)
doBroadcastMessage('[Lottery]\nWinner: '.. getCreatureName(winner) ..',\nItem: '.. (stackable and t.stackable_amount ..' ' or '') .. (stackable and getItemInfo(item).plural or getItemNameById(item)) .. '!\nCongrationlations!\n(Next GameDrop In '.. t.lottery_hour ..')')
if t.website then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item) .."', '".. getConfigValue('worldId') .."');")
end
end
return true
]]></globalevent>
</mod>
in MODS and should I make a xml line or something or is this all?ModsCode:<?xml version="1.0" encoding="UTF-8"?> <mod name="Lottery" enabled="yes"> <config name="lottery_config"><![CDATA[ t = { lottery_hour = "45 Min", -- Time to next lottery (you set the real time on interval, it's only for the broadcast message.) rewards_id = {2494, 2472, 2514, 2195, 2470, 2656, 7895, 2160}, -- ID's of rewards stackable_amount = 20, -- amount, if this it's a stackable item website = true -- Do you have `lottery` table in your database? } ]]></config> <globalevent name="lottery" interval="3600" event="buffer"><![CDATA[ domodlib('lottery_config') local list = getPlayersOnline() if #list > 0 then local winner, item = list[math.random(#list)], t.rewards_id[math.random(#t.rewards_id)] local stackable = getItemInfo(item).stackable doPlayerAddItem(winner, item, stackable and t.stackable_amount or 1) doBroadcastMessage('[Lottery]\nWinner: '.. getCreatureName(winner) ..',\nItem: '.. (stackable and t.stackable_amount ..' ' or '') .. (stackable and getItemInfo(item).plural or getItemNameById(item)) .. '!\nCongrationlations!\n(Next GameDrop In '.. t.lottery_hour ..')') if t.website then db.executeQuery("INSERT INTO `lottery` (`name`, `item`, `world_id`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(item) .."', '".. getConfigValue('worldId') .."');") end end return true ]]></globalevent> </mod>
in MODS and should I make a xml line or something or is this all?
Do you know how to add to all account 5 premium points? and thanks It worked!make a xml file called mysterygift.xml and put this in and restart the server
UPDATE accounts SET premium_points = premium_points + 5;Do you know how to add to all account 5 premium points? and thanks It worked!