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

[EO 1.5.0] Player Message Fix


EclipseCommunity
 Share

Recommended Posts

**Please note:** My game uses **/p** instead of the original **!** command. I have posted this tutorial using **/p** but you can change it back if you like. Just don't forget to update your **/help** command to show the new player message command if you wish to keep **/p**.

**CLIENT**

Find:
```
' Player message
```
Replace that whole section with this:

```
' Player message
        If Left$(ChatText, 3) = "/p " Then
            ChatText = Mid$(ChatText, 4, Len(ChatText) - 3)
            Name = vbNullString

            ' Get the desired player from the user text
            For I = 1 To Len(ChatText)

                If Mid$(ChatText, I, 1) <> Space(1) Then
                    Name = Name & Mid$(ChatText, I, 1)
                Else
                    Exit For
                End If

            Next

            ' Make sure they are actually sending something
            If Len(ChatText) - I > 0 Then
                ChatText = Mid$(ChatText, I + 1, Len(ChatText) - I)
                ' Send the message to the player
                Call PlayerMsg(ChatText, Name)
            Else
                Call AddText("Usage: /p playername (message)", AlertColor)
            End If

            MyText = vbNullString
            frmMain.txtMyChat.text = vbNullString
            Exit Sub
        End If
```
Find **Buffer.WriteLong CSayMsg** in **Sub PlayerMsg**

Replace with:
```
Buffer.WriteLong CPlayerMsg
```

**SERVER**

Find **Call PlayerMsg(GetPlayerName(index), "Cannot message yourself.", BrightRed)** in **Sub HandlePlayerMsg** and replace with:

```
Call PlayerMsg(index, "Cannot message yourself.", BrightRed)
```

Done :)
Link to comment
Share on other sites

I'm guessing it was stopped because it clashed with the 'PlayerMsg' call. Also, I tried this out, with "@", and it just came up with [Map]Sekaru: @Noob hi
Link to comment
Share on other sites

@Sekaru:

> I'm guessing it was stopped because it clashed with the 'PlayerMsg' call. Also, I tried this out, with "@", and it just came up with [Map]Sekaru: @Noob hi

You don't just change the command string, you need to change these values:

If Left$(ChatText, **3**) = "/p " Then
            ChatText = Mid$(ChatText, **4**, Len(ChatText) - **3**)
Link to comment
Share on other sites

@SnowFox:

> Thanks, bro :).
>
> If you manage to fix the tileset bugs.. please release Xd.

wat.  There's no tileset bug.  EO just manages its tilesets in a way that has problems when the tileset is huge.

Anyways, looks very nice.  I like that you can change it easily(even though All of EO has this ease xD)
Link to comment
Share on other sites

@Xlithan:

> Regardless. I couldn't find a fix for it in the forums. Some people need to realise that there ARE people on this forum who struggle to fix simple things like this, and require the assistance of more experienced programmers to help them.

He meant to say 'nice'. xD
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
ugh idk why but when i Put all this stuff in exactly, it says when i type in /p (playersname) and then a message it says [Map]Tester: (playersname).

Idk whats wrong I checked over a thousand times, and also when I just regularly type anything like blah it says Player not online. and when i type t is says Cannot message yourself any help?
Link to comment
Share on other sites

@Whackeddie99:

> ugh idk why but when i Put all this stuff in exactly, it says when i type in /p (playersname) and then a message it says [Map]Tester: (playersname).
>
> Idk whats wrong I checked over a thousand times, and also when I just regularly type anything like blah it says Player not online. and when i type t is says Cannot message yourself any help?

*facepalm*



THATS BECAUSE NOBODY IS ON YOUR GAME AND WHEN YOU MESSAGED YOUR SELF IT OBVIOUSLY WILL SAY "Cannot message yourself"

EDIT: oh i feel dumb i just reread your post my bad man ^^
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...