NPC Code:
// This goes in the database (db)
if (created || initialized) {
t = s;
timeout = 1;
}
if (timeout) {
t++;
if (t>=86400)
t = 0; // resets time
s = t;
timeout = 1;
}
NPC Code:
// this goes in the weapon
i = s; // gets the curent time
h = int(i / 3600); // the hour
m = int((i - h * 3600) / 60); // the min
s = int((i - h * 3600) - (m * 60)); // the sec
if (h > 10) {
setstring this.p,AM; // changed to am and pm
}else {setstring this.p,PM;}
h ++;
if (h > 12) {
h -= 12; // 12 hour mode
}
if (m < 10) {
setstring this.m,0#v(m); // enables 01-09
}else {setstring this.m,#v(m);}
if (s < 10) {
setstring this.s,0#v(s); // enables 01-09
}else {setstring this.s,#v(s);}
*Note: you have to add something in here to show the time for instance:
NPC Code:
showimg 999,@ariel@bottom@#v(h):#s(this.m):#s(this.s) #s(this.p) #s,20,screenheight-30;
changeimgvis 999,5;
changeimgzoom 999,1;
If you find any bugs please post them here. Also if oy uhave any suggestions, suggest away. Im only here to help.
You need to stop the DB script befor you can set the time. Its scripted s oyou can shange server flags without disturbing the time, thank you for oyur support. ~bloodpet
I actualy thought the this.m and this.s were needed rather then doign some other if comands followed by multiple display scritps that get messy.....