Quote:
Originally Posted by Gunderak
setTimer works in a DBNPC, are you sure it's frame based?
|
Frame-based in the sense that the timeout value decreases by (1 / Max FPS). On the server-side the Max FPS is 10, and on the client-side it's 20 (Like Dusty mentioned).
That is why it's useless to set timeouts lower than 0.1 on the server-side and 0.05 on the client-side. (Depending on the application you should be using the highest or no timeout at all if possible).
Play with this script:
PHP Code:
function onCreated() {
this.test = timevar2;
this.speed = 0.05;
setTimer(this.speed);
}
function onTimeout() {
echo(timevar2 - this.test);
this.test = timevar2;
setTimer(this.speed);
}
Both 0.05 and 0.1 will return similar values.