View Single Post
  #2  
Old 05-25-2001, 06:16 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
I'm gonna edit this...just multiply the last number on the line by the first on the next line to get the next number, it's the same as you had though
when timevar *
.2 then on the server its 5 minutes *
60 then on the server its 1 hour *
24 then on the server its 1 day *
30 then on the server its 1 month *
12 then on the server its 1 year
NPC Code:

this.minute = int(timevar / .2)%60;
this.hour = int(this.minute / 60)%24;
this.day = int(this.hour / 24)%30;
this.month = int(this.day / 30)%12;
this.year = int(this.month / 12);


hope that makes sense. You basically start with what you're fiding (minutes), find how many there are, divide by how many minutes were in 1 of the previous thing (timevar) and get the remainder when divided by the maximum of that type you can have (how many in an hour). The stuff in ()'s pertains to finding minutes. good job with your versoin though It got the job done, just would be pretty laggy when the numbers got higher;

-Kyle
Reply With Quote