DateTime Guild War

12/16/2009 08:16 Arcо#1
Alright well in the 5165 source I made a datetime start for guild war.
Here's the code.
Code:
public static void GuildWarTime()// On or Off
        {
            if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour == 2 && DateTime.Now.Minute == 15)
            {
                StartWar();
            }
        }
Here's the StartWar void:
Code:
 public static void StartWar()
        {
            Init();
            World.SendMsgToAll("SYSTEM", "Guild War has begun!", 2011, 0);
            War = true;
        }
It doesn't work though.
Nothing happens when it hits that time.
Anyone see anything wrong?
12/16/2009 10:11 felipeboladao#2
need of some ajusts *----*

need add hour and minute to finality Guild war.

And Full Work Code ;D
12/16/2009 10:12 Arcо#3
Quote:
Originally Posted by felipeboladao View Post
need of some ajusts *----*

Well no duh.
Thanks for stating the obvious.
I got this fixed.
#Request close.
12/16/2009 10:34 _Emme_#4
The check is in a void, which means you have to check the check void (lol) all the time, which is not the way to do it. Put the datetime code in a timethread and it should work fine.
12/16/2009 10:41 Arcо#5
Quote:
Originally Posted by EmmeTheCoder View Post
The check is in a void, which means you have to check the check void (lol) all the time, which is not the way to do it. Put the datetime code in a timethread and it should work fine.

Lol I already fixed it but thanks.
12/16/2009 11:10 tanelipe#6
Closed