Thread: Clock thing :O
View Single Post
  #1  
Old 09-25-2003, 06:54 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
Clock thing :O

woo woo, I was bored in school :-/.
NPC Code:

// NPC made by Knuckles
//#CLIENTSIDE
if (created || timeout) {
if(this.clock == 0) {
for(i=0; i<=12; i++) {
showtext 3+i,sin(pi-(pi*2)/12*i)*8+30,cos(pi-(pi*2)/12*i)*8+29.4,verdana,b,.;
changeimgzoom 3+i,.6;
}
this.clock = 1;
}
setfocus 30,30;
showpoly 1,{30,30,sin(pi-(pi*2)/60*this.sec)*7+30,cos(pi-(pi*2)/60*this.sec)*7+30}; // Second hand
changeimgcolors 1,.5,0,0,.9;
showpoly 2,{30,30,sin(pi-(pi*2)/60*this.min)*5+30,cos(pi-(pi*2)/60*this.min)*5+30}; // Minute hand
changeimgcolors 2,0,.9,0,.9;
showpoly 3,{30,30,sin(pi-(pi*2)/12*this.hour)*3+30,cos(pi-(pi*2)/12*this.hour)*3+30}; // Hour hand
changeimgcolors 3,0,0,.5,.9;

this.sec = (this.sec+1)%60;
if(this.sec == 59) this.min = (this.min+1)%60;
if(this.min == 59) this.hour = (this.hour+1)%12;
timeout = 0.05;
}



Just change the timeout to one, to make it in actual seconds.
Attached Thumbnails
Click image for larger version

Name:	clock.png
Views:	197
Size:	7.5 KB
ID:	25667  
__________________
Knuckles
"They say 60% of the time, it works everytime!"
Reply With Quote