15.10.2010, 14:24
Hello,
It's been a while ago since ive created this time-script, but today i really noticed that it gives some annoying lagg sometimes. I have set the timer to 2000 milliseconds. This is my code:
Does anyone see whats the laggy part, and how can i change it to minimalize/remove the lagg?
Greetz,
Danny
It's been a while ago since ive created this time-script, but today i really noticed that it gives some annoying lagg sometimes. I have set the timer to 2000 milliseconds. This is my code:
Код:
public Worldtime() {
if(Minutes < 60) {
Minutes += 1;
SyncPlayerTime();
} else {
if(Hours < 23) {
Hours += 1;
Minutes = 0;
SetWorldTime(Hours);
SyncPlayerTime();
} else {
Hours = 0;
Minutes = 0;
SetWorldTime(Hours);
SyncPlayerTime();
}
}
}
public SyncPlayerTime() {
for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
SetPlayerTime(i,Hours,Minutes);
}
}
}
Greetz,
Danny


)