Mirage Engine
/pm instead of ! - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: /pm instead of ! (/showthread.php?tid=156)



/pm instead of ! - Gilgamesch - 02-07-2006

hey guys,

ok i have this problem:

i want to write
Quote:/pm Gilgamesch Hello!
Instead of:
Quote:!Gilgamesch Hello!


This is the code, but unfortuantely i didnt know how a nd what to change to get it to work, and if you knbow the fix, please post it and explain it to me! thanks!
Code:
' 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: !playername msghere", AlertColor)
            End If
            MyText = ""
            Exit Sub
        End If



- Anarchy - 02-07-2006

Not shure if this is all that is needed but

take this code
Code:
Call AddText("Usage: !playername msghere", AlertColor)

and change to
Code:
Call AddText("Usage: /pm playername msghere", AlertColor)

if that doesnt im a retard or theres more to it


EDIT:
Id check it but sadly i dont have vb anymore


- Tosuxo - 02-07-2006

dude... that's to just like say how to USE it... not to make it work Tongue

you'll have to make it detect that you're saying /pm and then make it send that message..... just make a new PM window... they're a LOT more fun and less clutter when you've got like... the main thing saying how much hp you've lost and damage done and stuff.. it's easy to miss a PM while hunting on MSE... i could release a basic PM window tutorial if people want?


- Gilgamesch - 02-07-2006

Tosuxo Wrote:dude... that's to just like say how to USE it... not to make it work Tongue

you'll have to make it detect that you're saying /pm and then make it send that message..... just make a new PM window... they're a LOT more fun and less clutter when you've got like... the main thing saying how much hp you've lost and damage done and stuff.. it's easy to miss a PM while hunting on MSE... i could release a basic PM window tutorial if people want?

that would be great if you d release a tut for that Smile

and @anarchy

#thanks that you are trying to help, but this doesnt work because as Tosuxo said, it just tells you how to use it Smile


- grimsk8ter11 - 02-07-2006

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



- Gilgamesch - 02-07-2006

grimsk8ter11 Wrote: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

thanks again Smile


- Leighland - 02-07-2006

this is what i use

Code:
' Player message
        If Mid(MyText, 1, 5) = "/tell" Then
            ChatText = Mid(MyText, 7, Len(MyText) - 6)
            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: /tell  ", AlertColor)
            End If
            MyText = ""
            frmMirage.txtChatText.Text = ""
            Exit Sub
        End If



- grimsk8ter11 - 03-07-2006

same exact thing cept you used tell imstead of pm