How do I make it so the world will send off a sound to all users repetedly between two times, like 15:36:02 and 15:36:12?
I've experimented with the GM_Time() verb in S_Admin, but I can't find out what to do after I get the time.
ID:173786
Nov 14 2003, 5:31 pm
|
|
In response to Yota
|
|
Yota wrote:
proc/Go(mob/M) spawn while(1) if(worldtime>mintime||worldtime<=maxtime) M << sound('Sound.wav') Not sure if that's what you want. It's not, since you didn't put a sleep() of any kind in that loop. Instant infinite loop. Lummox JR |
In response to Yota
|
|
As Lummox JR mentioned, that's a non-sleeping infinite loop. You also want && in the if() rather than ||, otherwise the condition will always be true! =) Also, you want world.realtime.
More like this: <code>proc/Go(mob/M) if(world.time>mintime && world.time<=maxtime) M << sound('Sound.wav') spawn(20) .() //Change the number here to change how often it's played</code> Note that mintime and maxtime must be in 1/10 seconds since 00:00:00 GMT, January 1, 2000. =) However, the above snippet is pretty much useless as it works off dates as well as times. So just ignore this entire post. =P |
In response to Crispy
|
|
I got it fixed using the Report date from S_Admin (without the date part) and using Stat().
proc/ReportDate(time) var/format = "hh:mm:ss" // took the "MM/DD/YYYY" out return time2text(time, format) mob/Stat() statpanel("Time") stat("[ReportDate(world.realtime)]") var/time = ReportDate(world.realtime) if(time >= "00:00:00"&& time <= "23:59:59")//forever world << sound('THEsound.wav') |
Not sure if that's what you want.
Of corse you'll substitute "worldtime", "mintime", and "maxtime" and a few other things.