kleitonalan
New Member
- Joined
- Mar 21, 2013
- Messages
- 289
- Reaction score
- 3
Code:
function onThink(interval, lastExecution)
local _Lib_Battle_Days = {
["Monday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Tuesday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Wednesday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Thursday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Friday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Saturday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
},
["Sunday"] = {
["13:00"] = {players = 10},
["23:00"] = {players = 12}
}
}
if _Lib_Battle_Days[os.date("%A")] then
local hours = tostring(os.date("%X")):sub(1, 5)
local tb = _Lib_Battle_Days[os.date("%A")][hours]
if tb and (tb.players % 2 == 0) then
local tp = doCreateItem(1387, 1, _Lib_Battle_Info.tpPos)
doItemSetAttribute(tp, "aid", 45000)
CheckEvent(_Lib_Battle_Info.limit_Time)
doBroadcastMessage("The event War Event was opened and We are waiting "..tb.players.." Players! Team divided into "..((tb.players)/2).." VS "..((tb.players)/2))
setGlobalStorageValue(_Lib_Battle_Info.storage_count, tb.players)
return true
end
end
return true
end