Jump to content

Recommended Posts

Posted (edited)

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
Edited by Croqueta

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.