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

CHAT ON MAP


cowin000
 Share

Recommended Posts

CLIENT SIDE

modEnumerations
Add in to the bottom of C's (above the last one)
```
CActionMsg
```
modClientTCP

```
Public Sub SendActionMsg(ByVal text As String)
Dim Buffer As clsBuffer
Dim text As String

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Set Buffer = New clsBuffer
    Buffer.WriteLong CActionMsg
    Buffer.WriteString text
    SendData Buffer.ToArray()
    Set Buffer = Nothing

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "PlayerMsg", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
SERVER

modEnumerations;

Add in to the bottom of C's (above the last one)
```
CActionMsg
```
modHandleData ; InitMessages

Add to the bottom of InitMessages
```
HandleDataSub(CActionMsg) = GetAddress(AddressOf HandleActionMsg)
```
modHandleData

```
Sub HandleActionMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
Dim text As String

Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()

text = Buffer.ReadString

SendActionMsg GetPlayerMap(index), Trim(text), White, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)

Set Buffer = Nothing
End Sub
```
Then just put the Call SendActionMsg(Msg) in the modInput - HandleKeyPresses

(This is offhand, so I didn't test it. debug with it if there's any problems. Shouldn't be however.
Link to comment
Share on other sites

….............your amazing mate....CHEERS :cheesy:.

You have helped me with Quests, Scripted Items.Tiles when I dident understand it. Yo have helped me make a flash video feature, and all on ur own time. I thanks u a million for all this :cheesy: :cheesy:
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...