I've noticed that most UC servers are looking for news systems.
Add this to all players and poof you can easily edit the news from the client, within the news system. Also, you can use HTML code so that you can edit your news more cleanly. This is what my news code on Vortex looks like so far.
PHP Code:
<font color = yellow> <font size = 5> <center> <b> Welcome To Vortex! </b> </center> <font size = 3><font color = black> <br><b> 8/10 - </b>8/10 - Test News 3 <br><b> 8/10 - </b>Test News 2<br><b> 8/10 - </b>Test Image: <img src = "block.png"> (test news 1)
That was just a few tests
Some HTML coding is
PHP Code:
<font color = COLOR> (Changes Color)
<font size = #> (Changes Size)
<b> Hi </b> (Makes Hi bold)
<br> (Skips a line)
<img src = "block.png"> (Would show block.png)
<img src = "http://www.mariowiki.com/images/thumb/f/ff/MvsDK_Toad.jpg/180px-MvsDK_Toad.jpg"> (Would show the link's image)
<center> Middle </center> (Centers the word Middle)
So, load this up in a weapon, also to edit who can edit the news get to line 122 and add your account to this.can. For all of you new scripters to add something to an array edit the array like this
PHP Code:
this.can = {"FIRST ACCOUNT", "SECOND ACCOUNT", "THIRD ACCOUNT"};
Okay, so here's the script, just load it in to a weapon, and add it to all player. Oh, and you can also toggle its visibility by pressing N.
PHP Code:
function onActionServerSide() {
if (params[0] == "getNews") {
triggerclient("gui", this.name, "returnNews", serverr.news);
}
if (params[0] == "Publish") {
serverr.news = params[1];
for (temp.p: allplayers) {
p.triggerclient("gui", this.name, "NNews");
}
}
if (params[0] == "reGetNews") {
triggerclient("gui", this.name, "Editor", serverr.news);
}
}
//#CLIENTSIDE
function onCreated() {
getIt();
}
function onKeyPressed(code, key, scancode) {
if (key == "N") {
if (NNews_Window1.visible == false) {
getIt();
} else {
NNews_Window1.hide();
}
}
}
function getIt() {
triggerserver("gui", this.name, "getNews");
}
function onActionClientSide() {
if (params[0] == "returnNews") {
openNews(params[1]);
}
if (params[0] == "NNews") {
getIt();
}
if (params[0] == "Editor") {
openNEditor(params[1]);
}
}
function openNews(newz) {
NNews_Window1.show();
new GuiWindowCtrl("NNews_Window1") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "737,343";
canmove = false;
canclose = false;
canmaximize = false;
canresize = false;
closequery = false;
destroyonhide = false;
text = "News";
x = ScreenWidth / 2 - 350;
y = ScreenHeight / 2 - 150;
new GuiButtonCtrl("NNews_Button1") {
profile = GuiBlueButtonProfile;
height = 34;
text = "Close News [N]";
width = 737;
y = 309;
}
new GuiButtonCtrl("NNews_Button2") {
profile = GuiBlueButtonProfile;
height = 34;
text = "Edit News (Admin Only)";
width = 737;
y = 275;
}
new GuiScrollCtrl("NNews_MultiLine1_Scroll") {
profile = GuiBlueScrollProfile;
height = 231;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 737;
y = 34;
new GuiMLTextCtrl("NNews_MultiLine1") {
profile = GuiBlueMLTextProfile;
height = 17;
horizsizing = "width";
plaintext = "Multi Line Text Field Standard Content";
text = newz;
width = 712;
}
}
new GuiTextCtrl("NNews_Text1") {
profile = GuiBlueTextProfile;
height = 20;
text = "Created By Toad";
width = 111;
x = 626;
}
}
}
function NNews_Button1.onAction() {
NNews_Window1.hide();
}
function NNews_Button2.onAction() {
this.can = {
"Graal749201", "Graal754954"
};
if (player.account in this.can) {
NNews_Window1.hide();
triggerserver("gui", this.name, "reGetNews");
NNews_Window2.show();
} else {
player.chat = "I don't have rights!";
}
}
function openNEditor(newk) {
new GuiWindowCtrl("NNews_Window2") {
profile = GuiBlueWindowProfile;
clientrelative = true;
clientextent = "860,376";
canmove = true;
canresize = false;
canmaximize = false;
canclose = false;
canminimize = false;
closequery = false;
destroyonhide = false;
text = "News Editor";
x = ScreenWidth / 2 - 400;
y = ScreenHeight / 2 - 150;
new GuiTextCtrl("NNews_Text2") {
profile = GuiBlueTextProfile;
height = 20;
text = "HTML coding is included!";
width = 162;
x = 345;
y = 7;
}
new GuiScrollCtrl("NNews_MultiLineEdit1_Scroll") {
profile = GuiBlueScrollProfile;
height = 294;
hscrollbar = "dynamic";
vscrollbar = "dynamic";
width = 860;
y = 31;
new GuiMLTextEditCtrl("NNews_MultiLineEdit1") {
profile = GuiBlueMLTextEditProfile;
height = 17;
horizsizing = "width";
plaintext = newk;
text = newk;
width = 835;
}
}
new GuiButtonCtrl("NNews_Button3") {
profile = GuiBlueButtonProfile;
height = 37;
text = "Publish News (done)";
width = 860;
y = 339;
}
}
}
function NNews_Button3.onAction() {
NNews_Window2.hide();
triggerserver("gui", this.name, "Publish", NNews_MultiLineEdit1.getText());
}
I am also working on updates such as Tabs for like event news, or any other news needed.
