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

A quick question


Scythe
 Share

Recommended Posts

ok i have looked up a whole bunch of tuts and looked at the source but i dont understand how to do this all tuts on the web are for making chats and i just need someone to explain the process in regard to eclipse
Link to comment
Share on other sites

When you click a button or want to get information from the Server, send a packet like so:

```
Call SendData("info" & END_CHAR)
```
In the Server modHandleData, you have to handle the packet, hence the name, so make a new case like this:

```
Case "info"
    Call Packet_Info(Index)
    Exit Sub
```
At the bottom of modHandleData, add Sub Packet_Info:

```
Sub Packet_Info(ByVal Index As Long)
    Dim Text as String

    Text = GetVar((file directory here))

    ' Send the data back to the Client
    Call SendDataTo(Index, "info" & SEP_CHAR & Text & END_CHAR)
End Sub
```
Since the Server is now sending data back to the Client, it only makes sense to need to handle the data somewhere in the Client, and that's modHandleData, so we need to create a new Case there as well:

```
Case "info"
    ' code here
Exit Sub
```
That's really all. Use the GetVar command to retrieve information from your Scripts folder, and then do whatever you want with the information in the Client.
Link to comment
Share on other sites

You don't need to create a new packet if you just want to add it to the text box. There's already a framework of packets which do the basics like that for you.

```
PlayerMsg(index, "This is some text", BrightRed
```
Will add it to their textbox.
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...