Raised This Month: $ Target: $400
 0% 

String Variable with get_time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raa
Senior Member
Join Date: Oct 2005
Old 12-31-2006 , 18:14   String Variable with get_time
Reply With Quote #1

Hi, I need a little help with getting the day of the week then determining if it's SAT, or SUN. then running code if its not one of those days.

This is a section of what I have so far;

Code:
public theday(){
new today[8] = {"SAT","SUN"}
get_time("%a", today, 3)

if(get_time("today") == SAT) || (get_time("today") == SUN)
	return PLUGIN_HANDLED
//somecode

}
spare some help? thanks..
raa is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-31-2006 , 18:25   Re: String Variable with get_time
Reply With Quote #2

Use this page for reference:
http://www.amxmodx.org/funcwiki.php?go=func&id=249

Code:
public something_function() {     new day[3]     get_time("%a", day, 2)         if(equal(day, "Sat"))     {         //it's saturday, execute whatever...     }     else if(equal(day, "Sun"))     {         //it's sunday, execute whatever...     } }
stupok is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-31-2006 , 18:43   Re: String Variable with get_time
Reply With Quote #3

Code:
public something_function() {     new day[1];     get_time("%w", day, 1)         if(equal(day, "6"))     {         //it's saturday, execute whatever...     }     else if(equal(day, "0"))     {         //it's sunday, execute whatever...     } }
__________________
Brad is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 01-01-2007 , 11:13   Re: String Variable with get_time
Reply With Quote #4

Code:
public something_function() {      new day[2]; // arraysize of 1 would generate runtime error 4 on the next line      get_time("%w", day, 1)      if(equal(day, "6"))      {          //it's saturday, execute whatever...      }      else if(equal(day, "0"))      {          //it's sunday, execute whatever...      } }
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode