Jump to content
×
×
  • Create New...
  • 0

Adicionar dia ao script


Tonyyx
 Share

Question

Versão do Servidor: TFS - 0.4
Tipo de Script: globalevent
Código:
 
local msg = {
    ['20:20'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:25'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:30'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:35'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}
}

function onThink(interval, lastExecution)
    local h = msg[os.date('%X'):sub(1, 5)]
    return h and doBroadcastMessage(h.text, h.type) or true
end

Queria que falasse apenas em dias específicos (configurável), no caso seria Sábado, Domingo, Terça E Quinta

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

 

function onThink(cid, interval)

	local days = {
		["Tuesday"] = {"20:20"},  -- Terça
		["Thursday"] = {"20:25"}, -- Quinta
		["Saturday"] = {"20:30"}, -- Sábado
		["Sunday"] = {"20:35"}	  -- Domingo
	}
	
	local hrs = tostring(os.date("%X")):sub(1, 5)
	local msgBroadcast = "Evento Up Aberto No Segundo Andar Do Temple" -- Mensagem do Broacast

		if days[os.date("%A")] and isInArray(days[os.date("%A")], hrs) then
			doBroadcastMessage(msgBroadcast)
		end	


	return true
end

 

 

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.