bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 Can someone tell me how to add a Send Player Message feature to frmServer.frm? I originally tried:```Private Sub cmdSendPlayerMessage_Click() Call PlayerMsg(txtSendTo.Text, txtToSend.Text, sldColor.Value)End Sub```But that gave me a Type Mismatch.**The first one to reply a working code will get credit!**>! sldColor is a slider I use to determine what color byte to use in a message. Link to comment Share on other sites More sharing options...
bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 Wait, I think I got it.**An admin can delete this post.** Link to comment Share on other sites More sharing options...
bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 Nope, I didn't get it.**An admin can delete this post.** Link to comment Share on other sites More sharing options...
Exception Posted June 11, 2012 Share Posted June 11, 2012 I'm assuming that in txtSendTo, and txtToSend, you have the players' names?You need their indexes. I believe you can use the function FindPlayer to compare the names, and return their indexes.Modify it to: ```Call PlayerMsg(FindPlayer(txtSendTo.Text), FindPlayer(txtToSend.Text), sldColor.Value)``` Link to comment Share on other sites More sharing options...
bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 @Lenn:> I'm assuming that in txtSendTo, and txtToSend, you have the players' names?> > You need their indexes. I believe you can use the function FindPlayer to compare the names, and return their indexes.> > Modify it to:> > ```> Call PlayerMsg(FindPlayer(txtSendTo.Text), FindPlayer(txtToSend.Text), sldColor.Value)> ```Actually, txtSendTo is who to send it to like you said, and txtToSend is the message. Plus that's what I **thought** would work in those two posts above. Link to comment Share on other sites More sharing options...
bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 @bunny123:> Actually, txtSendTo is who to send it to like you said, and txtToSend is the message. Plus that's what I **thought** would work in those two posts above.Wait a second, I tried```GetPlayerName(txtSendTo.Text)```. Let me try what you said now. Link to comment Share on other sites More sharing options...
bunny123 Posted June 11, 2012 Author Share Posted June 11, 2012 @Lenn:> I'm assuming that in txtSendTo, and txtToSend, you have the players' names?> > You need their indexes. I believe you can use the function FindPlayer to compare the names, and return their indexes.> > Modify it to:> > ```> Call PlayerMsg(FindPlayer(txtSendTo.Text), FindPlayer(txtToSend.Text), sldColor.Value)> ```**It worked!** 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