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

Tabbed Chat!


aster
 Share

Recommended Posts

credits to Soul Greendude120 ツ and Damian i got code from ES, just explained how to add to EE cuz im not a fan of ES
ok well alot of you have been asking for the drop down chat bar to choose between global, guild, private etc. This will aslo add a new feature to your game guild chat!!
GUILD CHAT DOESNT SHOW UP ON THE SERVER LOG! not to big of a prob tho
first off let make a ComboBox in frmMirage that is heigth 21 width 97 style 2-dropdown
visible = true text, mapchat name, mapchat (put this next to the bar where u enter your message) almost forgot on the list in item properties make 4 0's looking like this
0
0
0
0

Next go into ModClientTCP go down to the guild section and below the last on paste this```
Sub GuildChat(ByVal Text As String)
    Call SendData("guildmsg" & SEP_CHAR & Text & END_CHAR)
End Sub
```
Next go into modGameLogic go down to handle key press and at the very first 'map message highlight everything all way to the last code before //commands// and delete it then paste this
```
        ' Map message
        If frmMirage.MapChat.Text = "Map" Then
            'Check if the user uses other chat then mapchat
            ' Broadcast message
            If Not Mid$(MyText, 1, 1) = "/" Then
                If Mid$(MyText, 1, 1) = "'" Then
                    ChatText = Mid$(MyText, 2, Len(MyText) - 1)
                    If Len(Trim$(ChatText)) > 0 Then
                        Call BroadcastMsg(ChatText)
                    End If
                    MyText = vbNullString
                    Exit Sub
                End If
            End If

            ' Emote message
            If Not Mid$(MyText, 1, 1) = "/" Then
                If Mid$(MyText, 1, 1) = "-" Then
                    ChatText = Mid$(MyText, 2, Len(MyText) - 1)
                    If Len(Trim$(ChatText)) > 0 Then
                        Call EmoteMsg(ChatText)
                    End If
                    MyText = vbNullString
                    Exit Sub
                End If
            End If

            ' Guild message
            If Not Mid$(MyText, 1, 1) = "/" Then
                If Mid$(MyText, 1, 1) = "@" Then
                    ChatText = MyText
                    If Len(Trim$(ChatText)) > 0 Then
                        Call GuildChat(ChatText)
                    End If
                    MyText = vbNullString
                    Exit Sub
                End If
            End If

            ' Player message
            If Not Mid$(MyText, 1, 1) = "/" Then
                If Mid$(MyText, 1, 1) = "!" Then
                    ChatText = Mid$(MyText, 2, Len(MyText) - 1)
                    Name = vbNullString

                    ' Get the desired player from the user text
                    For I = 1 To Len(ChatText)
                        If Mid$(ChatText, I, 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: !playername msghere", AlertColor)
                    End If
                    MyText = vbNullString
                    Exit Sub
                End If

                If Len(Trim$(MyText)) > 0 Then
                    Call SayMsg(MyText)
                End If
                MyText = vbNullString
                Exit Sub
            End If
        End If

        ' Broadcast message
        If frmMirage.MapChat.Text = "Global" Then
            ChatText = MyText
            If Len(Trim$(ChatText)) > 0 Then
                Call BroadcastMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If

        ' Emote message
        If Mid$(MyText, 1, 1) = "-" Then
            ChatText = Mid$(MyText, 2, Len(MyText) - 1)
            If Len(Trim$(ChatText)) > 0 Then
                Call EmoteMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If

        ' Guild message
        If frmMirage.MapChat.Text = "Guild" Then
            ChatText = MyText
            If Len(Trim$(ChatText)) > 0 Then
                Call GuildChat(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If

        ' Player message
        If frmMirage.MapChat.Text = "Private" Then
            ChatText = MyText
            Name = vbNullString

            ' Get the desired player from the user text
            For I = 1 To Len(ChatText)
                If Mid$(ChatText, I, 1) <> " " Then
                    Name = Name & Mid$(ChatText, I, 1)
                Else
                    Exit For
                End If
            Next I

            ' 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: !playername msghere", AlertColor)
            End If
            MyText = vbNullString
            Exit Sub
        End If

```

You're done with the client side now you want to go to your server and add

now go into modHandleData in your server and look for the Cases and put this```

        Case "guildmsg"
            Call Packet_GuildMsg(index, Parse(1))
            Exit Sub
```now go to the Very bottom of modHandleData and paste this```
Public Sub Packet_GuildMsg(ByVal index As Long, ByVal Msg As String)
    Dim I

    ' Prevent hacking
    For I = 1 To Len(Msg)
        If Asc(Mid$(Msg, I, 1)) < 32 Or Asc(Mid$(Msg, I, 1)) > 255 Then
            Call HackingAttempt(index, "Broadcast Text Modification")
            Exit Sub
        End If
    Next I

    If GetPlayerGuild(index) = "" Then
        Call PlayerMsg(index, "your not in a guild...", BRIGHTRED)
        Exit Sub
    End If

    For I = 1 To MAX_PLAYERS
        If IsPlaying(I) Then
        If GetPlayerGuild(index) = GetPlayerGuild(I) And GetPlayerGuild(I) <> "" Then
            Call PlayerMsg(I, "[Guild : " & GetPlayerName(index) & "]: " & Msg, BRIGHTCYAN)
        End If
        End If
    Next I

End Sub

```This is my first ever tutorial at anything so give me props for trying =P
Credits The Soul Numb and Damian666 for guild code
Link to comment
Share on other sites

not to be a ass…

but i see my guild code...

yours...
```
Public Sub Packet_GuildMsg(ByVal index As Long, ByVal Msg As String)
    Dim I

    ' Prevent hacking
    For I = 1 To Len(Msg)
        If Asc(Mid$(Msg, I, 1)) < 32 Or Asc(Mid$(Msg, I, 1)) > 255 Then
            Call HackingAttempt(index, "Broadcast Text Modification")
            Exit Sub
        End If
    Next I

    If GetPlayerGuild(index) = "" Then
        Call PlayerMsg(index, "your not in a guild...", BRIGHTRED)
        Exit Sub
    End If

    For I = 1 To MAX_PLAYERS
        If IsPlaying(I) Then
        If GetPlayerGuild(index) = GetPlayerGuild(I) And GetPlayerGuild(I) <> "" Then
            Call PlayerMsg(I, "[Guild : " & GetPlayerName(index) & "]: " & Msg, BRIGHTCYAN)
        End If
        End If
    Next I

End Sub

```
and this is mine…

```
Public Sub Packet_GuildMsg(ByVal Index As Long, ByVal Msg As String)
    Dim I

    ' Prevent hacking
    For I = 1 To Len(Msg)
        If Asc(Mid$(Msg, I, 1)) < 32 Or Asc(Mid$(Msg, I, 1)) > 255 Then
            Call HackingAttempt(Index, "Broadcast Text Modification")
            Exit Sub
        End If
    Next I

    If GetPlayerGuild(Index) = "" Then
        Call PlayerMsg(Index, "your not in a crew...", BRIGHTRED)
        Exit Sub
    End If

    For I = 1 To MAX_PLAYERS
        If IsPlaying(I) Then
        If GetPlayerGuild(Index) = GetPlayerGuild(I) And GetPlayerGuild(I) <> "" Then
            Call PlayerMsg(I, "[Crew : " & GetPlayerName(Index) & "]: " & Msg, GREEN)
        End If
        End If
    Next I

End Sub

```
what about credit? im not a credit whore, but this is not nice of ya…

you could atleast state the source where ya get it...

Damian666
Link to comment
Share on other sites

  • 1 month later...
@мсичġġєт:

> @[SB:
>
> > Soul link=topic=53410.msg582016#msg582016 date=1259983778]
> > I think this is pretty old, this was back when my name was TSN.
>
> so 1564 posts ago?

Like 100, I changed it because everyone calls me Soul anyways.

Yeah this is old though, I remember helping him out with this.
Link to comment
Share on other sites

  • 2 weeks later...
Kay, I'll test…
Well...
I got another error, the "Name" Isn't declared, I made it a string, then "I", As integer...
Then it said that there can't be a "End if" Whit out "Block If", deleted the "end if"...
Now it dosn't show any error, but...
It dosn't work to send anything, and the combo box is still full of 0.
Link to comment
Share on other sites

Dude, like wow. this is a really dick move. This goes to everyone:

Do not steal someones code or take it from the engine if it already comes with it and then post it as if it was your own. Not exactly sure how you got that code cause it was suppose to be me and damian only, but what u did there was steal someones work.

In school you would of got kicked out and perhaps arrested cause universities and shit dont accept stealing work. its actually illegal.

hope this serves example for everyone

EDIT: you only have 52 posts (one of which u stole codes) and ur name is EclipseStalker… give u a good first impression
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...