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

Whisper button not working??


JayT
 Share

Recommended Posts

hey im making a whisper button in vb for my game i have it all ready but its not workin lol. i have this:
```
Private Sub Command4_Click()
If Len(ptext.Text) > 3 Then
                Call PlayerMsg(ptext.Text, "wtext.text", 5)
                End If
End Sub
```
it says wrong number of arguments or invalid property assignment! any ideas?

ptext.text = the players name

wtext.text = the msg they are sending
Link to comment
Share on other sites

ok now i got this:```
Private Sub Command4_Click()
Dim Index As Long
If Len(wtext.Text) - Index > 0 Then
                wtext.Text = Mid$(wtext.Text, Index + 1, Len(wtext.Text) - Index)
                ptext.Text = Mid$(ptext.Text, Index + 1, Len(ptext.Text) - Index)
                ' Send the message to the player
                Call PlayerMsg(ptext.Text, wtext.Text)
            Else
                Call AddText("Usage: !playername msghere", AlertColor)
            End If
            MyText = vbNullString
            Exit Sub

End Sub
```
that get the players name from ptext.Text and sends and msg but sends his name aswell it dont send the text from wtext.Text…... can any1 help me with this?
Link to comment
Share on other sites

*facedeskfacedeskfacedeskfacedeskfacedesk*

```
Private Sub Command4_Click()
    If Len(wtext.Text) > 0 Then
        Call PlayerMsg(ptext.Text, wtext.Text)
        wtext.Text = vbNullString
    End If
End Sub

```Don't just copy and paste random code from other places in the client, it leads to more bugs.

**Edit:** I'm stupid too, I had exit sub in there.
Link to comment
Share on other sites

@Umbra!:

> *facedeskfacedeskfacedeskfacedeskfacedesk*
>
> ```
> Private Sub Command4_Click()
>     If Len(wtext.Text) > 0 Then
>         Call PlayerMsg(ptext.Text, wtext.Text)
>         wtext.Text = vbNullString
>     End If
> End Sub
>
> ```Don't just copy and paste random code from other places in the client, it leads to more bugs.
>
> **Edit:** I'm stupid too, I had exit sub in there.

thanks umbra but u got 1 thing wrong :P lol wtext and ptext needed switching round :P but yer that works!!
Edit: i did the exit sub thing earlier aswell lol
Link to comment
Share on other sites

yer i thort that lol thats y i posted this in the first time cos i had that code u gave me first but it kept send the players name lol so i fiddled with it and messed it up then u came and posted same code apart from the Len bit and it worked but needed switching round lol
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...