Register for your free account! | Forgot your password?

You last visited: Today at 19:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]Dayofweek

Discussion on [Help]Dayofweek within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
[Help]Dayofweek

Alright so i am writing a code and im wanting it to do something only on one day of the week

How i went about doing this is like this

Code:
if (DayOfWeek.Monday)
            {
                //blah blah blah
            }

I thought about using System.DayOfWeek.Monday

That did not seem to work either

so if someone could tell me a way of going about doing this id be appreciative

Thanks
hunterman01 is offline  
Old 12/08/2009, 22:37   #2
 
elite*gold: 0
Join Date: Aug 2009
Posts: 930
Received Thanks: 448
try using dates? not sure. you'd just have to change more often.. i like your idea better, but im not sure how it'd work
.Guru is offline  
Old 12/08/2009, 22:40   #3
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Yeah its saying That it cannot convert System.DayOfWeek to a bool but im a little confused
hunterman01 is offline  
Old 12/08/2009, 22:52   #4
 
Nirion's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 99
Received Thanks: 33
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
Nirion is offline  
Thanks
1 User
Old 12/08/2009, 23:16   #5
 
elite*gold: 0
Join Date: Dec 2009
Posts: 1
Received Thanks: 0
@Hunter
Why ain't you guardian anymore?
Inactivity?
Werew0lf is offline  
Old 12/08/2009, 23:21   #6
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Quote:
Originally Posted by Nirion View Post
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
You Put that in world.cs ? To make A Certain thing Work on a Sertain time?

Ex..
Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Minute == 55))
{
QuizShow.Start
}
Where would i place something like that? not the actual thing tho
-Shunsui- is offline  
Old 12/09/2009, 02:29   #7
 
elite*gold: 0
Join Date: Aug 2009
Posts: 930
Received Thanks: 448
Quote:
Originally Posted by Nirion View Post
This should work..I have my quiz show & guild war set to work on certain days with this.

Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
{

}
yeah that should work
.Guru is offline  
Old 12/09/2009, 03:37   #8
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Quote:
Originally Posted by Werew0lf View Post
@Hunter
Why ain't you guardian anymore?
Inactivity?
idk just found out i wasnt a guardian wierd 0.0
hunterman01 is offline  
Old 12/09/2009, 03:46   #9
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Stay on topic, If you got your answer Report close this thread.
-Shunsui- is offline  
Old 12/09/2009, 03:58   #10
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
lol Yesa masta -.-
hunterman01 is offline  
Old 12/09/2009, 04:16   #11
 
elite*gold: 0
Join Date: Dec 2009
Posts: 8
Received Thanks: 1
#request close
Threadstarter got his answer
Z0DIAC is offline  
Old 12/09/2009, 04:24   #12
 
ImFlamedCOD's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 140
Quote:
Originally Posted by -Shunsui- View Post
Stay on topic, If you got your answer Report close this thread.
Since the question was answered correctly I thought you let you know topic starters are premited to close there own topics and reopen them on will.
ImFlamedCOD is offline  
Old 12/09/2009, 04:36   #13
 
Nirion's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 99
Received Thanks: 33
Quote:
Originally Posted by -Shunsui- View Post
You Put that in world.cs ? To make A Certain thing Work on a Sertain time?

Ex..
Code:
if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday && DateTime.Now.Minute == 55))
{
QuizShow.Start
}
Where would i place something like that? not the actual thing tho
Actually I placed my timed event in the run void in MyThread.cs....I don't know why I put it there but it wouldn't work anywhere else I tried.
Nirion is offline  
Thanks
1 User
Old 12/09/2009, 04:42   #14
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
See no reason to close this thread people are still getting help here
(like me)

But yeah i just needed this i think i might need one other thing


How would i make something stop at a certain time lets saying 12:00
hunterman01 is offline  
Old 12/09/2009, 08:38   #15
 
Huseby's Avatar
 
elite*gold: 106
Join Date: Oct 2006
Posts: 6,047
Received Thanks: 1,164
Quote:
Originally Posted by ImFlamedCOD View Post
Since the question was answered correctly I thought you let you know topic starters are premited to close there own topics and reopen them on will.
Nope, only mods(In there dedicated area), global mods and Admins are premited to use the #Close function

stay on topic guys.
Huseby is offline  

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.