View Single Post
  #4  
Old 05-26-2010, 08:25 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
why are you using const flags? lol

HTML Code:
function onCreated(){
  this.allowed = {"ACCT1", "ACCT2", "ACCT3"};
  this.admins = {"ACCT1", "ACCT2"};
  
  this.d_open = true;
  this.show();
}

function onPlayerTouchsMe(){
  if(this.d_open == true || (this.d_open == null && player.account in this.allowed)) {
    this.hide();
    setTimer(2);
  }
}
  //For some reason, the timeout is less laggy (clientside, ever so slightly, thought I'd add it)
function onTimeout() {
  this.show();
}

function onPlayerChats(){
  if(!(player.account in this.admins)) return;

  if(player.chat == "/allowall") this.d_open = true;
  else if (player.chat == "/disallowall") this.d_open = false;
  else if(player.chat.starts("/allow")) {
      temp.act = player.chat.substring(7);
      this.allowed.add(temp.act);
      player.chat = temp.act SPC "is now allowed through!";
  }
}
(don't need a const...)
__________________
Reply With Quote