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 = "System: 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("
" @ params[2] @ ": " @ params[1], false);
Msg2_Chatbox.scrolltobottom();
play("emeraguibuttonclick.wav");
}
}