JayT Posted July 29, 2009 Author Share Posted July 29, 2009 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 IfEnd Sub```it says wrong number of arguments or invalid property assignment! any ideas?ptext.text = the players namewtext.text = the msg they are sending Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 29, 2009 Share Posted July 29, 2009 I don't think you can have something in front of sub Link to comment Share on other sites More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 so u think i gotta put the whole call playermsg sub in? Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 29, 2009 Share Posted July 29, 2009 Is that a whole sub? Link to comment Share on other sites More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 nah just the command to call a player msg lol i was tryin to cheat with that simple little snippet of code but i guess i gotta put the whole sub in Link to comment Share on other sites More sharing options...
Mr. Bob Firefarter Posted July 29, 2009 Share Posted July 29, 2009 Nevermind then. Link to comment Share on other sites More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 ok now i got this:```Private Sub Command4_Click()Dim Index As LongIf 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 SubEnd 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 More sharing options...
emblem Posted July 29, 2009 Share Posted July 29, 2009 *facedeskfacedeskfacedeskfacedeskfacedesk*```Private Sub Command4_Click() If Len(wtext.Text) > 0 Then Call PlayerMsg(ptext.Text, wtext.Text) wtext.Text = vbNullString End IfEnd 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 More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 @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 More sharing options...
emblem Posted July 29, 2009 Share Posted July 29, 2009 What part is it switched around at?The Len(wtext.Text)or the Call PlayerMsg part? Link to comment Share on other sites More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 the call msg part :P Link to comment Share on other sites More sharing options...
emblem Posted July 29, 2009 Share Posted July 29, 2009 Weird.You said ptest.text is the name, and wtext.text is the message.The call is Call PlayerMsg(MsgTo, Message):/ Link to comment Share on other sites More sharing options...
JayT Posted July 29, 2009 Author Share Posted July 29, 2009 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 More sharing options...
emblem Posted July 29, 2009 Share Posted July 29, 2009 Again, weird.ah well at least it works. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now