Thread: staff gui modes
View Single Post
  #1  
Old 10-16-2007, 07:43 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
staff gui modes

so I made a staff tool that looks like this. Simply edit the "this.tools" part, it's also staff locked [clientr.staff]

HTML Code:
function onActionServerside(action, mPos) {
  if (temp.action == "layobject") {
    if (clientr.staff == false) {
      return false;
    }
    
    putnpc2(temp.mPos[0], temp.mPos[1], "join " @ client.staffAction @ ";");
  }
}

//#CLIENTSIDE
function onCreated() {
  this.tools = {
    //Name, Image, Classname
    {"Pumpkin", "era_pumpkin2.gif", "pumpkin"},
    {"Candy", "era_hallowcandy1.gif", "hallowcandy"},
  };
  this.drawMenu();
}

function drawMenu() {
  showpoly(200, {(screenwidth - 50),0, screenwidth,0, screenwidth,(this.tools.size() * 32) + 5, (screenwidth - 50),(this.tools.size() * 32) + 5});
  changeimgvis(200, 4);
  changeimgcolors(200, 0, 0, 0, 1);
  
  for (temp.tool: this.tools) {
    temp.yPos = (temp.ind * 32);
    showimg(202 + temp.ind, temp.tool[1], (screenwidth - 45), temp.yPos);
    changeimgvis(202 + temp.ind, 5);
    
    this.bPos.add({temp.ind, temp.yPos});
    temp.ind++;
  }
}

function onMouseDown() {
  if (params[0] != "left") {
    if (client.staffAction != false) {
      player.chat = "No object selected!";
      client.staffAction = false;
    }
    return false;
  }
    
  if (!(mousescreenx in |screenwidth - 45, screenwidth|)) {
    if (client.staffAction == false) {
      return false;
    }
    triggerserver("weapon", this.name, "layobject", {mousex, mousey});
    return false;
  }
  for (temp.i: this.bPos) {
    if (mousescreeny in |(temp.i[0] * 32), (temp.i[1] + 32)|) {
      player.chat = "Selected" SPC this.tools[temp.i[0]][0];
      scheduleevent(0.05, "DrawImage", this.tools[temp.i[0]][1]);      

      client.staffAction = this.tools[temp.i[0]][2];
      break;
    }
  }
}                

function onDrawImage(img) {    
  (temp.img == false? hideimg(201): showimg(201, temp.img, (mousex - 1.5), (mousey - 1.5)));
  changeimgvis(201, 3);
  
  if (temp.img != false) {
    scheduleevent(0.05, "DrawImage", (client.staffAction != false? temp.img: false));
  }
}
here's a snapshot
Attached Thumbnails
Click image for larger version

Name:	era_guithing.PNG
Views:	647
Size:	38.2 KB
ID:	43088  
__________________
Reply With Quote