View Single Post
  #2  
Old 05-07-2015, 12:50 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Because you're referring directly to the player, I'd put the check INSIDE the class. Otherwise you're defying the point of player classes.

Inside the 'foobar' class I'd do the following
HTML Code:
  //Call the check on login
function onCreated() {
  this.createVariables();
}

  //Do the check here
public function createVariables() {
  if (this.foo != null && this.bar != null) return;

  this.foo = 1;
  this.bar = 2;
}
__________________
Reply With Quote