ALTERA SCRIPT

macalo
Por macalo
em Scripts

macalo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/05/15Posts: 53

BOM EU QUERIA Q ESSES SCRIPT INICIA-SE TODO DIAS MAIS SO INICIAS 2 DIAS NA SEMANA ! VLW REP +

[LUA]--[[
 day_of_week: 0 = Sunday, 1 = Monday ... 6 = Saturday
 hour: value between 0 and 23
 minute: value between 0 and 59
 storage: unique, not used global storage value
 --]]

 local autoStartsTable = {
 {["day_of_week"] = 6, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7867},
 {["day_of_week"] = 0, ["hour"] = 21, ["minute"] = 0, ["storage"] = 7868}
 }

 function shouldExecuteEvent(configTable)
 for _, config in pairs(configTable) do
 if(tonumber(os.date("%d")) ~= getStorage(config.storage) and tonumber(os.date("%w")) == config.day_of_week) then
 if(tonumber(os.date("%H")) == config.hour and tonumber(os.date("%M")) == config.minute) then
 doSetStorage(config.storage, tonumber(os.date("%d")))
 return true
 end
 end
 end
 return false
 end

 function onThink(interval, lastExecution, thinkInterval)
 if(shouldExecuteEvent(autoStartsTable)) then
 if(getStorage(ZE_STATUS) ~= 1 and getStorage(ZE_STATUS) ~= 2) then
 removeZombiesEventBlockEnterPosition()
 doSetStorage(ZE_STATUS, 1)
 doBroadcastMessage("Zombie Arena Event teleport will be open for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.")
 addEvent(startArenaEvent, 120 * 1000)
 end
 end
 return true
 end

 function startArenaEvent()
 if(getStorage(ZE_STATUS) == 1) then
 addZombiesEventBlockEnterPosition()
 doSetStorage(ZE_STATUS, 2)
 doBroadcastMessage("Zombie Arena Event started.")
 end
 end

Danihcv

I'm Coordenador, Bitch!
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 08/04/15Posts: 926Gênero: Masculino

Deixa assim:

[LUA]--[[
 day_of_week: 0 = Sunday, 1 = Monday ... 6 = Saturday
 hour: value between 0 and 23
 minute: value between 0 and 59
 storage: unique, not used global storage value
 --]]

 local autoStartsTable = {
 {["day_of_week"] = 6, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7867},
 {["day_of_week"] = 5, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7869},
 {["day_of_week"] = 4, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7870},
 {["day_of_week"] = 3, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7871},
 {["day_of_week"] = 2, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7872},
 {["day_of_week"] = 1, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7873},
 {["day_of_week"] = 0, ["hour"] = 21, ["minute"] = 0, ["storage"] = 7868}
 }

 function shouldExecuteEvent(configTable)
 for _, config in pairs(configTable) do
 if(tonumber(os.date("%d")) ~= getStorage(config.storage) and tonumber(os.date("%w")) == config.day_of_week) then
 if(tonumber(os.date("%H")) == config.hour and tonumber(os.date("%M")) == config.minute) then
 doSetStorage(config.storage, tonumber(os.date("%d")))
 return true
 end
 end
 end
 return false
 end

 function onThink(interval, lastExecution, thinkInterval)
 if(shouldExecuteEvent(autoStartsTable)) then
 if(getStorage(ZE_STATUS) ~= 1 and getStorage(ZE_STATUS) ~= 2) then
 removeZombiesEventBlockEnterPosition()
 doSetStorage(ZE_STATUS, 1)
 doBroadcastMessage("Zombie Arena Event teleport will be open for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.")
 addEvent(startArenaEvent, 120 * 1000)
 end
 end
 return true
 end

 function startArenaEvent()
 if(getStorage(ZE_STATUS) == 1) then
 addZombiesEventBlockEnterPosition()
 doSetStorage(ZE_STATUS, 2)
 doBroadcastMessage("Zombie Arena Event started.")
 end
 end


Não esquece que vc pode alterar a hora de inicioa pra cada dia.
Basta alterar a parte referente a hour e minute referente aql determinado dia.

Te ajudei?? REP+ e ficamos quites... happyy.png

Atenciosamente,
                    Danihcv.
                           Abraços!

macalo

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/05/15Posts: 53

vlw !!

Danihcv

I'm Coordenador, Bitch!
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 08/04/15Posts: 926Gênero: Masculino

Tópico movido para dúvidas / pedidos resolvidos.

Te ajudei?? REP+ e ficamos quites... happyy.png

Atenciosamente,
                    Danihcv.
                           Abraços!