Thread: Countdown Timer
View Single Post
  #19  
Old 12-07-2011, 03:08 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Gunderak View Post
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.
__________________
Quote:

Last edited by fowlplay4; 12-07-2011 at 03:26 AM..
Reply With Quote