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

Add news in frmMain (very very simple)


Chukillz
 Share

Recommended Posts

Ok i figured it all out…

This is my first tutorial so please dont yell at me

This is how you would add a News Section In your game.

All Client Side:

First, in client/data files/

Add a new txt doc and name it ingame_news.txt

now for the coding part!

in frmMain find
```
Private Sub Form_Load()
```add below this
```
Dim tmpTxt As String, tmpArray() As String, i As Long
```
next in frmMain find
```
picCover.width = picScreen.width + 2
```add below this
```
' load news
    Open App.Path & "\data files\ingame_news.txt" For Input As #1
        Line Input #1, tmpTxt
    Close #1
    ' split breaks
    tmpArray() = Split(tmpTxt, "
")
    lblNews.Caption = vbNullString
    For i = 0 To UBound(tmpArray)
        lblNews.Caption = lblNews.Caption & tmpArray(i) & vbNewLine
    Next
```
now go into your frmMain interface and add a new label called lblNews

save and compile

Then you are done!

Thats all it takes very very simple (if i can do it you can do it) :P
Link to comment
Share on other sites

the ingame_news.txt will show only in the frmMain after you add a label. and the news.txt that came with the original source will only be used in frmMenu. incase you dont want the same news in both…if you only want to use the same news in both frmMenu and frmMain then just change this line
```
Open App.Path & "\data files\ingame_news.txt" For Input As #1
```into this
```
Open App.Path & "\data files\news.txt" For Input As #1
```or where ever you have your news.txt file.

so the answer to your question would be this…

The news you want shown on the Menu of your game.. you put it in news.txt and the news that you want shown in the ingame then just put it in ingame_news.txt i will upload a screenshot
Link to comment
Share on other sites

It's a good start, but very ineffective, as this means the news file is client side and wouldnt be updates from the server.

Without programming it for you, look at adding a new for SSendNews enumerator, then a handle method on the client, and a send method on the server to send whenever a connection is made
Link to comment
Share on other sites

exactly what do you mean by adding the news in to the server when editing the news was never sent from the server in the first place from what i have seen.

i am a complete noob when it comes to this lmao…i am still trying to figure things out. any tips and hins would be great
Link to comment
Share on other sites

  • 4 weeks later...

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...