Jump to content

[Q]noticia por quest


Croqueta

Mensajes recomendados

Qui presento una nueva quest q ise, ella escribe noticias por horas o minutos diarios, aun q el gm q la empeso este offline.para cambiar los textos tienen q ver q ustedes qieren aser por horas o minutos, para q los den una noticia por hora cambien en esta parte

['hour']={

la hora de noticia, por ejmpl.

[14]='hola a todos aora son '..os.date("%H:%M:%S").." Horas",

[horas]='noticia',y con los minutos es lo mismo, con mucho gusto, Noa 

quest time_notice begin	state start begin		when 9009.chat."noticia automatica" with pc.is_gm() begin			say_title(mob_name(npc.get_race()))			say()			say("Tiempo del server: "..os.date("%H:%M:%S"))			say("el systema de noticia esta "..({[0]="Apagada",[1]="Ensendida"})[game.get_event_flag("loop_time")])			say("q qieres aser?")			local s= select("Ensender","Apagar","cerrar")			if s==3 then return end			if s==1 then				game.set_event_flag("loop_time",1)				server_loop_timer("loop_time",2,get_server_timer_arg())			else				game.set_event_flag("loop_time",0)				clear_server_timer("loop_time")			end			say("systema de noticia "..({"Esendido","Apagado"})[s])		end		when loop_time.timer begin			local time_notice={				['hour']={					[14]='hola a todos aora son '..os.date("%H:%M:%S").." Horas",					[18]='Preparanse para dormir, maña se tiene q levantarse temprano',					['min']={						[16]='hola queridos jugadores, no se olvide votar todos los dias',						[17]='Test1',						[18]='Test2',					},				}			}			if game.get_event_flag("hour_time")!=tonumber(os.date("%H")) and game.get_event_flag("min_time")!=tonumber(os.date("%M")) then				game.set_event_flag("hour_time",0) game.set_event_flag("min_time",0)				for zeit,text in pairs(time_notice.hour) do					if type(zeit)=='number' then						if zeit==tonumber(os.date("%H")) then							notice_all(text)							game.set_event_flag("hour_time",tonumber(os.date("%H")))						end					end					if type(text)=='table' then						table.foreach(time_notice['hour']['min'],						function(t_ime,t_ext)							if t_ime==tonumber(os.date("%M")) then								notice_all(t_ext)								game.set_event_flag("min_time",tonumber(os.date("%M")))							end						end)					end				end			end		end 	endend
Editado por Croqueta
Enlace para comentar
Compartir en otros sitios

Unirse a la conversación

Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.

Guest
Responder a este tema...

×   Has pegado contenido con formato .   Eliminar formato

  Only 75 emoji are allowed.

×   Tu enlace se ha incorporado automáticamente.   Mostrar un enlace en su lugar

×   Se ha restaurado el contenido anterior. .   Borrar editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...