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

[Request] ! private message system


gregnator
 Share

Recommended Posts

Hey guys, i've tried and tried to fix it.. but i cant, the closest i've came was that everytime you talk it says player is not online… i've tried everything... looked in the resources, found a *fix* but that made it worse.. this is most likely going to be my LAST request from you guys..

i just dont know how to fix this...

```
        ' Player message
        If Left$(ChatText, 3) = "!" Then
            Exit Sub
            ChatText = Mid$(ChatText, 2, 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

            ChatText = Mid$(ChatText, i, Len(ChatText) - 1)

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

            MyText = vbNullString
            frmMain.txtMyChat.text = vbNullString
            Exit Sub
        End If
```
I posted my code so that you CAN see that i've tried…
Link to comment
Share on other sites

@Captain:

> Hey guys, i've tried and tried to fix it.. but i cant, the closest i've came was that everytime you talk it says player is not online… i've tried everything... looked in the resources, found a *fix* but that made it worse.. this is most likely going to be my LAST request from you guys..
>
> i just dont know how to fix this...
>
> ```
>         ' Player message
>         If Left$(ChatText, 3) = "!" Then
>             Exit Sub
>             ChatText = Mid$(ChatText, 2, 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
>
>             ChatText = Mid$(ChatText, i, Len(ChatText) - 1)
>
>             ' Make sure they are actually sending something
>             If Len(ChatText) - i > 0 Then
>                 MyText = Mid$(ChatText, i + 1, Len(ChatText) - i)
>                 ' Send the message to the player
>                 Call PlayerMsg(ChatText, Name)
>             Else
>                 Call AddText("Usage: !playername (message)", AlertColor)
>             End If
>
>             MyText = vbNullString
>             frmMain.txtMyChat.text = vbNullString
>             Exit Sub
>         End If
> ```
> I posted my code so that you CAN see that i've tried…

You have to send the player message with the player's index, not the players name.
Link to comment
Share on other sites

not my system, trying to fix the !playername message private system.. But it doesnt want to work, the closest ive been to making it work was screwing it up.. with that i mean, i could use normal chat, cuz everytime i'd chat like normal it would say: player is not online. and when i did Playername, it send a private message but without text.. so im a bit desperate atm, i could show you the modinput
Link to comment
Share on other sites

Probably would've been easier to just try again. I followed the fix and it worked just fine. Remember to always read the other posts too and not just the topic, since fixes are sometimes posted without the OP being edited. Don't remember if that's the case here.
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...