Ryujin Posted August 12, 2011 Author Share Posted August 12, 2011 This is my second Tutorial.I tell you, how to can send messages in different colours.Before we beginn, we need following things:1x ComboBox (cbColours)First, click on the ComboBox (cbColours) and search in the properties for **List**Enter the following into the list:```BlackBlueGreenCyanRedMagentaBrownGreyDarkGreyBrightBlueBrightGreenBrightCyanBrightRedPinkYellowWhite```**THEN CHANGE IN THE PROPERTIES AT "STYLE" 0 TO 2**Second, search for **Private Sub Form_Load()**.Below **Call UsersOnline_Start** add **cbColours.Text = "White"**Thirdly, search for **Private Sub txtChat_KeyPress(KeyAscii As Integer)**Change this:```Private Sub txtChat_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then If LenB(Trim$(txtChat.Text)) > 0 Then Call GlobalMsg(txtChat.Text, White) Call TextAdd("Server: " & txtChat.Text) txtChat.Text = vbNullString End If KeyAscii = 0 End IfEnd Sub```WITH THIS (THX to [7](http://www.touchofdeathforums.com/smf/index.php?action=profile;u=22287)):```Private Sub txtChat_KeyPress(KeyAscii As Integer)If KeyAscii = vbKeyReturn Then If LenB(Trim$(txtChat.Text)) > 0 Then Select Case cbColours.Text Case "Black" Call GlobalMsg("Server: " & txtChat.Text, Black) Case "Blue" Call GlobalMsg("Server: " & txtChat.Text, Blue) Case "Green" Call GlobalMsg("Server: " & txtChat.Text, Green) Case "Cyan" Call GlobalMsg("Server: " & txtChat.Text, Cyan) Case "Red" Call GlobalMsg("Server: " & txtChat.Text, Red) Case "Magenta" Call GlobalMsg("Server: " & txtChat.Text, Magenta) Case "Brown" Call GlobalMsg("Server: " & txtChat.Text, Brown) Case "Grey" Call GlobalMsg("Server: " & txtChat.Text, Grey) Case "DarkGrey" Call GlobalMsg("Server: " & txtChat.Text, DarkGrey) Case "BrightBlue" Call GlobalMsg("Server: " & txtChat.Text, BrightBlue) Case "BrightGreen" Call GlobalMsg("Server: " & txtChat.Text, BrightGreen) Case "BrightCyan" Call GlobalMsg("Server: " & txtChat.Text, BrightCyan) Case "BrightRed" Call GlobalMsg("Server: " & txtChat.Text, BrightRed) Case "Pink" Call GlobalMsg("Server: " & txtChat.Text, Pink) Case "Yellow" Call GlobalMsg("Server: " & txtChat.Text, Yellow) Case "White" Call GlobalMsg("Server: " & txtChat.Text, White) Case Else Call GlobalMsg("Server: " & txtChat.Text, Black) End Select Call TextAdd("Server: " & txtChat.Text) txtChat.Text = vbNullString End If KeyAscii = 0 End IfEnd Sub```Done!**At the end it looks like this:**![](http://www.freemmorpgmaker.com/files/imagehost/pics/27388679143c496c6898ff7553ad7ae2.JPG)**Big THX to the DEVELOPERS OF ES SERVER EDIT!****EDITED: Now is done!** Link to comment Share on other sites More sharing options...
RyokuHasu Posted August 12, 2011 Share Posted August 12, 2011 Nice edit, but not very useful. ^_^ Link to comment Share on other sites More sharing options...
Yxxe Posted August 12, 2011 Share Posted August 12, 2011 @Ryoku:> Nice edit, but not very useful. ^_^Just because it isn't useful to you doesn't mean it won't be to someone else. Link to comment Share on other sites More sharing options...
kibbelz Posted August 12, 2011 Share Posted August 12, 2011 @Lightning:> Just because it isn't useful to you doesn't mean it won't be to someone else.agreed, although it would be nice if you also contunied the tutorial client sided aswell so that players can make their own coloured messages. Link to comment Share on other sites More sharing options...
Ryochi Posted August 14, 2011 Share Posted August 14, 2011 there's already a tut for that kibblez. Link to comment Share on other sites More sharing options...
Craselin Posted August 18, 2011 Share Posted August 18, 2011 @Ryoku:> Nice edit, but not very useful. ^_^Truthfully I think it is useful, you could have different types of annoucements in different colours, for example you could announce countdowns to events in blue and advertise new maps in green, etc, etc :) Link to comment Share on other sites More sharing options...
Carim123 Posted August 18, 2011 Share Posted August 18, 2011 Thanks for this, was needing something like this.Well, just to share, for organisations sake;``` If KeyAscii = vbKeyReturn Then If LenB(Trim$(txtChat.Text)) > 0 Then Select Case cbColours.Text Case "Black" Call GlobalMsg("Server: " & txtChat.Text, Black) Case "Blue" Call GlobalMsg("Server: " & txtChat.Text, Blue) Case "Green" Call GlobalMsg("Server: " & txtChat.Text, Green) Case "Cyan" Call GlobalMsg("Server: " & txtChat.Text, Cyan) Case "Red" Call GlobalMsg("Server: " & txtChat.Text, Red) Case "Magenta" Call GlobalMsg("Server: " & txtChat.Text, Magenta) Case "Brown" Call GlobalMsg("Server: " & txtChat.Text, Brown) Case "Grey" Call GlobalMsg("Server: " & txtChat.Text, Grey) Case "DarkGrey" Call GlobalMsg("Server: " & txtChat.Text, DarkGrey) Case "BrightBlue" Call GlobalMsg("Server: " & txtChat.Text, BrightBlue) Case "BrightGreen" Call GlobalMsg("Server: " & txtChat.Text, BrightGreen) Case "BrightCyan" Call GlobalMsg("Server: " & txtChat.Text, BrightCyan) Case "BrightRed" Call GlobalMsg("Server: " & txtChat.Text, BrightRed) Case "Pink" Call GlobalMsg("Server: " & txtChat.Text, Pink) Case "Yellow" Call GlobalMsg("Server: " & txtChat.Text, Yellow) Case "White" Call GlobalMsg("Server: " & txtChat.Text, White) Case Else Call GlobalMsg("Server: " & txtChat.Text, Black) End Select Call TextAdd("Server: " & txtChat.Text) txtChat.Text = vbNullString End If KeyAscii = 0 End If``` Link to comment Share on other sites More sharing options...
Beanie93 Posted August 18, 2011 Share Posted August 18, 2011 Or he can use ElseIf, but I find Select Case better.Good begginer tutorial! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now