Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Change MOTD from server


Domino_
 Share

Recommended Posts

When you finish this tutorial in your server you will be avabile to edit motd without loging in game or opening options.ini
There may be better way to do this and if you know it please say. :D

**All Server Side.**
In Controls
make 2 commands ( cmdLoadMOTD and cmdMOTDChange )
and make textbox ( txtMOTD )
Like this:
![](http://www.bildites.lv/images/9f9dwkyxtllxln88s6n.png)

**In frmServer code just paste this**
```
Function ReadFile()
Dim ReadFileName As String
ReadFile = GetVar(App.Path & "\data\options.ini", "OPTIONS", "MOTD")
txtMOTD.Text = ReadFile
Close #1
End Function

Private Sub cmdLoadMOTD_Click()
ReadFile
End Sub

Function WriteFile()
Dim WriteFileName As String
PutVar App.Path & "\data\options.ini", "OPTIONS", "MOTD", Options.MOTD
Options.MOTD = txtMOTD.Text
Close #1
End Function

Private Sub cmdMOTDChange_Click()
WriteFile
End Sub
```
Update!
Change
```
Private Sub cmdMOTDChange_Click()
WriteFile
End Sub
```to
```
Private Sub cmdMOTDChange_Click()
WriteFile
    Call GlobalMsg("MOTD changed to: " & txtMOTD.Text, BrightCyan)
End Sub
```
Link to comment
Share on other sites

  • 7 months later...
Use the following code to send a global message:
Call GlobalMsg("(Message)", (Color))

Colors:
Black, Blue, Green, Cyan, Red, Magenta, Brown, Grey, DarkGrey, BrightBlue, BrightGreen, BrightCyan, BrightRed, Pink, Yellow, White, SayColor, GlobalColor, BroadcastColor, TellColor, EmoteColor, AdminColor, HelpColor, WhoColor, JoinLeftColor, NpcColor, AlertColor, NewMapColor
Link to comment
Share on other sites

  • 2 weeks later...
@DarkBeast:

> I feel stupid but I think my way is easier.

/motd is client side… I made it server side to load and make new...
In client if you make mistake in text somewhere you have to rewrite it but from server side you load and edit the wrong part....
Link to comment
Share on other sites

In all honesty, you're better off making an option on the admin panel for it. I mean usually when a server is hosted it is hosted on a remote computer that you don't use for anything BUT hosting a server, so you don't have any access to it aside from remote desktop or whatever half the time. Would you really want to connect to a remote desktop or walk over there to change a silly message each and every time?

Just a word of advice. ;]
(Note: Not saying the idea is bad, just saying it's probably better to keep it client-side on the admin panel)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...