Graal Pastebin

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

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.rgba) {
  for (temp.pl: allplayers)
  pl.triggerclient("gui", this.name, "gettext2", msg, title, rgba);
}
 
//#CLIENTSIDE
function onCreated() {
  sendtochatroom("helloz", "Server", {
    1, 2, 1, 1
  });
  new GuiControl("Msg2_Window1") {
    useownprofile = true;
    profile.border = 1;
    profile.opaque = true;
    visible = false;
    profile.fillColor = {
      0, 55, 150, 225
    };
    width = 328.5;
    destroyonhide = true;
    height = 250;
    canmove = true;
    x = 517;
    y = 203;
    new GuiScrollCtrl("Msg2_Chatbox_Scroll") {
      profile = GuiBlueScrollProfile;
      height = 215;
      hscrollbar = "dynamic";
      vscrollbar = "dynamic";
      width = 316;
      x = 6.5;
      y = 6.5;
      new GuiMLTextCtrl("Msg2_Chatbox") {
        temp.version = "2.3";
        profile = GuiBlueMLTextProfile;
        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 = GuiBlueTextEditProfile;
      height = 20;
      width = 316;
      x = 6;
      y = 225;
    }
  }
}
 
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 = cyan>" @ params[2] @ "</b>: " @ params[1], false);
    Msg2_Chatbox.scrolltobottom();
  }
}
 
function onKeyPressed(num1, code, num2) {
  if (code == "1") {
    if (Msg2_Window1.visible == true) {
      Msg2_Window1.visible = false;
      player.chat = "Chat Room: OFF!";
    } else {
      Msg2_Window1.visible = true;
      player.chat = "Chat Room: ON!";
    }
  }
}
  • 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
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98