Graal Pastebin

New Paste
Pasted on September 5, 2011.
View the raw file

function onCreated() {
  sendtochatroom("Reminder: This channel is for contacting staff members only! There will be a seperate channel up in future for general chat!", "Server", 1, 0, 1);
}
 
function onActionServerSide() {
  if (params[0] == "sendtext2") {
    for (temp.pl: allplayers) {
      if (temp.pl.level != NULL) {
        temp.pl.triggerclient(this.name, "gettext2", params[1], player.nick);
      }
    }
  }
}
 
public function sendtochatroom(temp.msg, temp.title, temp.r, temp.g, temp.b) {
  for (temp.pl: allplayers) {
    pl.triggerclient("gui", this.name, "gettext2", msg, title, r, g, b);
  }
}
 
//#CLIENTSIDE
function onCreated() {
  new GuiWindowCtrl("Msg2_Window1") {
    profile = GuiWindowProfile;
    clientrelative = true;
    clientextent = "320,240";
    visible = true;
    canmaximize = false;
    canmove = true;
    canresize = false;
    closequery = false;
    destroyonhide = false;
    canclose = false;
    text = "Staff Chat Channel";
    x = 517;
    y = 203;
    new GuiScrollCtrl("Msg2_Chatbox_Scroll") {
      profile = GuiScrollProfile;
      height = 215;
      hscrollbar = "dynamic";
      vscrollbar = "dynamic";
      width = 316;
      x = 2;
      y = 2;
      new GuiMLTextCtrl("Msg2_Chatbox") {
        temp.version = "2.3";
        profile = GuiMLTextProfile;
        height = 17;
        horizsizing = "width";
        text = "<b><font color = white>System</b>: Input /clear to clear the message box.";
        width = 312;
        profile.fontsize = 14.3;
        profile.fonttype = "Arial";
        profile.textshadow = false;
      }
    }
    new GuiTextEditCtrl("Msg2_ChatBar") {
      profile = GuiTextEditProfile;
      height = 20;
      width = 316;
      x = 2;
      y = 218;
    }
  }
}
 
function Msg2_ChatBar.onAction() {
  temp.msg2 = "";
  if (Msg2_ChatBar.text == "/clear") {
    Msg2_Chatbox.text = "Cleared!";
  } else {
    if (Msg2_ChatBar.text != NULL) {
      temp.msg2 = Msg2_ChatBar.text;
      triggerserver("weapon", this.name, "sendtext2", temp.msg2);
      Msg2_ChatBar.text = "";
    }
  }
  if (temp.msg2.starts("/font ")) {
    say2("Works");
  }
}
 
function onActionClientSide() {
  if (params[0] == "gettext2") {
    Msg2_Chatbox.addtext("<br><b><font color = lightgreen>" @ params[2] @ "</b>: " @ params[1], false);
    Msg2_Chatbox.scrolltobottom();
    play("emeraguibuttonclick.wav");
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89