Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help: Hmm
#1
Code:
Mid(GetPlayerName(i), 1, Val(Parse$(3)))

That line of code can only equal to one exact name, like:

Code:
william

But it cant also equal to:
Code:
William

So how can you make it so it can be both capslock letters and not?
Reply
#2
Nice.. I'll check it out.
Reply
#3
Code:
f MsgToString = LCase(Mid(GetPlayerName(i), 1, Val(Parse$(3)))) Or MsgToString = Mid(GetPlayerName(i), 1, Val(Parse$(3))) Then

Works fine now. Thanks Big Grin

I made a page system, so all you need to write is this:

Code:
The name of the person you want to page is Verrigan, but all you need to do is write this:

/ver hello man
or
/Verri hello
or
/ve hey
Reply
#4
Dave Wrote:Man, I feel sorry for "Ve-rrigan", "Ve-ctor", "Ve-23" all those Ve names, how will you determine which one the message is for?
It will take the one with the smallest index. Sometimes you might page wrong. But overall this system is good for long names Smile
Reply
#5
no it wont. T4C uses the same system. And you can write the full name if you wish.
Reply
#6
Just do the same thing on the char creation (case-insensitive) and you'll be fine.

/whisper Spodi
/whisper spodi
/whisper SPODI

All the same in the end. But there can be only one Spodi made. :wink:
Reply
#7
LCase() only makes it work like this:
Will
will


This isnt working for it:
wILL
WilL
Reply
#8
I don't know what you're smoking, but I'm pretty sure LCase changes the entire string to lowercase, not just the first letter. Changing the first letter of a word is called converting to propercase, vb has another function for that.(I think its like strconv(string,vbproppercase)
Reply
#9
Problem.

2 players. One named John. The other Johnson. Johnson has a lower index number. How'd you PM John?
Reply
#10
@Missunderstood: If you look above I had "or" in the if statement. Which means I can either have it all like william. Or as it was written correctly: William.

@Joost: well kick them.
Reply
#11
Heres the bloody code:
Server
Code:
Case "playermsg"
        MsgToString = Parse$(1)
        For i = 1 To HighIndex
            If MsgToString = LCase$(Mid$(GetPlayerName(i), 1, Val(Parse$(3)))) Or MsgToString = Mid$(GetPlayerName(i), 1, Val(Parse$(3))) Then
                D = i
            End If
        Next i
        MsgTo = D
        Msg = Parse$(2)

client
Code:
Sub PlayerMsg(ByVal Text As String, ByVal MsgTo As String, ByVal i As Byte)
Dim packet As String

    packet = "playermsg" & SEP_CHAR & MsgTo & SEP_CHAR & Text & SEP_CHAR & i & SEP_CHAR & END_CHAR
    Call SendData(packet)
End Sub


Code:
' Player message
        If Mid$(MyText, 1, 1) = "/" Then
            ChatText = Mid$(MyText, 2, Len(MyText) - 1)
            Name = vbNullString
                    
            ' 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, i - 1)
            Else
                Call AddText("Usage: /playername msghere (The whole player name is not needed to be written. Also remember to write the correct caps.", AlertColor)
            End If
            MyText = vbNullString
            frmMirage.txtMyChat.Text = vbNullString
            Exit Sub
        End If

Now stop telling me everything that sucks with it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)