View Single Post
  #3  
Old 09-18-2010, 02:49 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Suggestion: put the following in a class and join in to the player

PHP Code:
function onCreated() {
  
this.setTimer(1);
}

// this should really be optimized to stop the timer if ≥100 and
// restart it when they use mana and it needs to regen
function onTimeOut() {
  if (
this.clientr.mudmp 100) {
    
this.clientr.mudmp ++;
  }
  
  
this.setTimer(1);

Not only is it much more secure, it also cuts down on wasted bandwidth (and is much simpler) . Not many people take advantage of the ability of timeouts to be used on the player object.
__________________
Reply With Quote