This is just a really basic (bare bones) of a chat system.
I decided to post it here seeming as I have no use for it.
I originally scripted it just for fun.
PHP Code:
function onActionServerSide() {
if (params[0] == "add") {
for (temp.pl: allplayers) {
pl.triggerclient("weapon", this.name, "add", player.nick, params[1]);
}
}
}
//#CLIENTSIDE
function onCreated() {
new GuiWindowCtrl("Chat_Window") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "320,240";
canclose = false;
canmaximize = false;
canminimize = false;
canmove = false;
canresize = false;
closequery = false;
destroyonhide = false;
text = "Chat";
x = screenwidth / 2 - width / 2;
y = screenheight / 2 - height / 2;
new GuiScrollCtrl("Chat_MultiLine_Scroll") {
profile = GuiBlueScrollProfile;
height = 221;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 320;
new GuiMLTextCtrl("Chat_MultiLine") {
profile = GuiBlueMLTextProfile;
height = 17;
horizsizing = "width";
text = "Welcome to the Chat system, Please be nice!";
width = 295;
}
}
new GuiTextEditCtrl("Chat_Bar") {
profile = GuiBlueTextEditProfile;
height = 20;
width = 320;
y = 220;
}
}
Chat_Window.destroy();
}
function Chat_Bar.onAction() {
triggerserver("weapon", this.name, "add", Chat_Bar.text);
Chat_Bar.text = "";
}
function onActionClientSide() {
if (params[0] == "add") {
Chat_MultiLine.addtext("<br>"@params[1]@": "@params[2], false);
Chat_MultiLine.scrolltobottom();
}
}
Also if you have any suggestions to improve it feel free to let the idea's flow freely.