21-03-2007, 04:04 PM
why keep saving the time and date to a file when it could easily be stored into memory... all you have to do is keep it in memory? :S
from what I see here you're writing to an ini file every minute which is just waste of CPU when it could store as 3 bytes in memory (hour min second)...
...just use a timer and make it update every 1000ms... (Interval = 1000), and make it get the server system clock data.... and if it's a certain number in hours or w.e. then it's day, else it's night
that's how MT's day/night system works, and it works flawlessly....
from what I see here you're writing to an ini file every minute which is just waste of CPU when it could store as 3 bytes in memory (hour min second)...
...just use a timer and make it update every 1000ms... (Interval = 1000), and make it get the server system clock data.... and if it's a certain number in hours or w.e. then it's day, else it's night
that's how MT's day/night system works, and it works flawlessly....