Author Topic: Change gamemode every sunday?  (Read 3819 times)

0 Members and 1 Guest are viewing this topic.

Offline benbrooks

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Change gamemode every sunday?
« on: February 23, 2008, 11:33:29 AM »
Hey, I run a dedicated server and I ususally run spacebuild every sunday and sandbox for the rest of the week, but I dont really like to execute the gamemodes manually incase im not there at the time...

Is it possible in any way (LUA is fine, and probably needed) to change a servers default gamemode on sundays?

e.g.
Quote
Sunday @ 12am - exec changegamemode sb_gooniverse spacebuld2
Monday @ 12am - exec changegamemode gm_construct sandbox

the "changegamemode" and its variables are how i would want them, and they would work, but I'd like it automated if possible.

Cheers in advance,
Ben.
« Last Edit: February 23, 2008, 11:35:30 AM by benbrooks »

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Change gamemode every sunday?
« Reply #1 on: February 23, 2008, 01:22:55 PM »
With os.date(), i think it's possible..run a timer that will check every hours, or maybe every minutes if you want (for accuracy), then when it's sunday, execute the command.

If you can't do it i'll make it a small ulx module ;)

Offline benbrooks

  • Newbie
  • *
  • Posts: 28
  • Karma: 2
Re: Change gamemode every sunday?
« Reply #2 on: February 23, 2008, 02:08:42 PM »
I'm not actually sure on how to use this.

I do know a little bit of LUA, But only a little.

If you could make that ULX module, I'd <3 you forever! :D

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Change gamemode every sunday?
« Reply #3 on: February 23, 2008, 02:59:39 PM »
Kyzer, I'm glad to see you back around. Been a while it seems.
A module release like this would be great. Tweak it a bit, make it nice featured. Add a config or even menu adjusted map and/or server restart timer too, with adjustable warning.
I think some used to have some releases like this in Gmod9/ULX 1 days. (I'm not going to look at our old releases archive, I know I've seen one somewhere if not here)

This is one of those nice little fun modules that would be reasonably simple but that we (Team Ulysses) didn't find main stream enough to include by default.
That, and perhaps we thought original authors of previous releases would rewrite.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Change gamemode every sunday?
« Reply #4 on: February 23, 2008, 03:11:17 PM »
Ya i'm back, i've moved home and no internet during months :)

I'll see what i can do for that module, i can't promise anything :D..i mean your thing, benbrooks, is probably very easy, but if i do it a module i'll do it like:

ulx_AddDelayedCommand <string:command> <no idea how to organize other arguments :)>

Edit: And for a menu..we will see (i'm not good with derma :()
« Last Edit: February 23, 2008, 03:14:41 PM by Kyzer »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Change gamemode every sunday?
« Reply #5 on: February 23, 2008, 03:30:15 PM »
Edit: And for a menu..we will see (i'm not good with derma :()

Doesn't have to be Derma/Hud menu. I don't believe it's too difficult to add it to the tab system under Utilities in the main Q Gmod menu.
Like where 'Undo' is.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming