How do i make so a tournament start automatical, is for LOTF (C#)
Sorry for asking, but i dunno remember >.<
Sorry for asking, but i dunno remember >.<
But thanks :DQuote:
if Time = XX:30
{
DeathMatch = true;
}
if Time = XX:40
{
DeathMatch = false;
That could work, or you could do something likeQuote:
Ya but how.
Is it in world.cs?
I mean like: (I know is not like this is just example)
But thanks :D
But i need some more help to add the things XD
System.Timers.Timer cTimer = new System.Timers.Timer(1000.0);
cTimer.Start();
cTimer.Elapsed += delegate{ StartTournament(); };
void StartTournament()
{
if(DateTime.Now == <YourValue>)
{
// Do whatever for tournament here
}
}
In this case a 1 min timer is max, you don't want to miss starting the tournament just because you used some large time spans, give it a small calculation at different values and consider that you might actually start up your server 10 minutes before your tournament is supposed to fire up, see if a 30 min timer will work with that. . and it will not lag anything up just because of a simple boolean operation :pQuote:
i would not use a 1 Second timer as it will lag up everithing.
i would make it atleast 30 -120 minutes
System.Timers.Timer cTimer = new System.Timers.Timer(1000.0);
cTimer.Start();
cTimer.Elapsed += delegate{ StartTournament(); };
void StartTournament()
{
if(DateTime.Now == <YourValue>)
{
// Do whatever for tournament here
}
}