View Single Post
  #10  
Old 07-27-2010, 12:23 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Just store day as a 0 to 6 value, and have your script convert that to a day (Monday, etc.) on the client.

Scripted Time in it's simplest form:

PHP Code:
function onCreated() {
  
setTimer(60);
}

function 
onTimeout() {
  
incrementTime();
  
setTimer(60);
}

function 
incrementTime() {
  
serverr.time_minute++;
  if (
serverr.time_minute == 60) {
    
serverr.time_minute 0;   
    
serverr.time_hour++;
    if (
serverr.time_hour == 24) {
      
serverr.time_hour 0;
      
serverr.time_day++;
      if (
serverr.time_day == 7) {
        
serverr.time_day 0;
      }
    }
  }

PHP Code:
//#CLIENTSIDE

function getCurrentDay() {
  return {
"Sunday""Monday""Tuesday""Wednesday""Thursday""Friday""Saturday"}[serverr.time_day];

It doesn't look all that pretty but whatever.
__________________
Quote:
Reply With Quote