02-07-2006, 04:51 PM
i hleped you with this before, off the top of my head i believe its this:
Code:
' Player message
If LCase(Mid(MyText, 1, 4)) = "/pm " Then
ChatText = Mid(MyText, 5, Len(MyText) - 4)
Name = ""
' 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: /pm name msghere", AlertColor)
End If
MyText = ""
Exit Sub
End If