Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   staff gui modes (https://forums.graalonline.com/forums/showthread.php?t=77201)

xAndrewx 10-16-2007 07:43 PM

staff gui modes
 
1 Attachment(s)
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


All times are GMT +2. The time now is 05:24 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.