- Dołączył
- Luty 6, 2010
- Posty
- 87
- Liczba reakcji
- 2
Scrypt Nie Moj Tylko Uzytkownika ,,Wontek"
Wystarczy globalevents\scripts\lottery.lua
rewards_id --Tam Trzeba Wpisac ID Itemki Ktora Mozna Wylosowac
Wystarczy globalevents\scripts\lottery.lua
Tlumaczenie Najwazniejszego:Pervera.pl korzysta z najnowszej wersji tego skryptu kt?ry to co napisa?e? ma ju? wbudowane domy?lnie, wystarczy wej?? do oryginalnego tematu.
I przypominam ?e jestem autorem tego skryptu jak i tematu na otland.PHP:<mod name="Lottery System" version="1.4" author="vDk" contact="zlom290@gmail.com" enabled="yes"> <config name="lottery_config"><![CDATA[ config = { lottery_hour = "3 Hours", -- Time to next lottery (only for broadcast message, real time you can set on globalevents.xml) rewards_id = {2494, 2472, 2514, 2160}, -- Rewards ID crystal_counts = 10, -- Used only if on rewards_id is crystal coin (ID: 2160). website = "yes" -- Only if you have php scripts and table `lottery` in your database! } ]]></config> <globalevent name="lottery" interval="10800" event="script"><![CDATA[ domodlib('lottery_config') function onThink(interval, lastExecution) local list = {} for i, tid in ipairs(getPlayersOnline()) do list[i] = 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("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Congratulations! (Next Lottery in " .. config.lottery_hour .. ")") else doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. getItemNameById(random_item) .. "! Congratulations! (Next Lottery in " .. 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>
rewards_id --Tam Trzeba Wpisac ID Itemki Ktora Mozna Wylosowac