Real System Date and Event plugin

● ARCHIVED · READ-ONLY
Started by Symbol_ 5 posts View original ↗
  1. I need something simple to use, that takes the date of the computer that my game is being played on, and uses it in game.

    It doesn't need to display time or date.

    All I need is for events to occur on halloween, easter, christmas etc when the Computers system date is on those days.

    I'm at my wits end at finding something that fits the bill. I'm aware of Orangetimesystem.hud but I've been at my wits end trying to find out how to reference specific dates in it.

    I'd be willing to physically pay someone money to make me a custom plugin just for me for this.

    Thanks
  2. I think all you need here is a little scripting! :kaojoy:

    I assume you want to store the value in a variable, so just use Control Variables > Set > Script:
    • Day of the month (1~31):
      Code:
      var d = new Date(); d.getDate()
    • Month of the year (0~11):
      Code:
      var d = new Date(); d.getMonth()
    Those two are all you'll need for checking Hallowe'en/Christmas; Easter may be a challenge though. :kaoswt: If you need other stuff, like the year, or the day of the week, you can find full details here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
  3. caethyril said:
    I think all you need here is a little scripting! :kaojoy:

    I assume you want to store the value in a variable, so just use Control Variables > Set > Script:
    • Day of the month (1~31):
      Code:
      var d = new Date(); d.getDate()
    • Month of the year (0~11):
      Code:
      var d = new Date(); d.getMonth()
    Those two are all you'll need for checking Hallowe'en/Christmas; Easter may be a challenge though. :kaoswt: If you need other stuff, like the year, or the day of the week, you can find full details here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

    When using \v[x] to return me date numbers it comes up as 2nd of the 8th? when it should be the 9th?
  4. @Symbol_ It's because getMonth() starts at 0. So your best bet would be to add 1

    PHP:
    new Date().getMonth() + 1
  5. Oh. This works, thanks !