Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jail Command Difficulty: 1/5 C&P (Now works with latest ver)
#1
So this is just an edit of DarkC's Kill command. Even still, I find it useful, so I decided to make it for MS4's newest version.

Here goes.

Client Side:

Find
Code:
CGetClasses = 1

And under it add:
Code:
CJailPlayer

Now find:
Code:
' // Mapper Admin Commands //

And above it add:
Code:
' Jail player
                Case "/jail"
                    If GetPlayerAccess(MyIndex) >= ADMIN_CREATOR Then
                        If UBound(Command) >= 1 Then
                            SendData CJailPlayer & SEP_CHAR & Command(1) & END_CHAR
                        End If
                    End If

Server Side:

Find:
Code:
CGetClasses = 1

Under it add:
Code:
CJailPlayer

Now find:
Code:
' :: Quit game packet ::

Under it add:
Code:
' ::::::::::::::::::::::::
        ' :: Jail Player Packet ::
        ' ::::::::::::::::::::::::
        Case CJailPlayer
        ' Prevent hacking...
        If GetPlayerAccess(Index) < ADMIN_CREATOR Then
            Call HackingAttempt(Index, "Admin Cloning")
        Exit Sub
    End If

n = FindPlayer(Parse(1))

    If n  Index Then
    If n > 0 Then
    'Sends messages out
        Call PlayerMsg(n, "You have been jailed by an admin.", BrightRed)
        Call GlobalMsg(GetPlayerName(n) & " has been jailed by an admin.", BrightRed)
    'Warp to Jail map (Change the coordinates to fit your needs)
        Call PlayerWarp(n, 5, 8, 8)
    Else
        Call PlayerMsg(Index, "Player is not online.", White)
    End If
    Else
        Call PlayerMsg(Index, "You cannot jail yourself!", White)
    End If

Exit Sub

And it's done! Tell me how I did, hope you like it.
Reply
#2
nice very nice
Reply
#3
one Wrote:ont forget to change
Code:
'Warp to starting map
        Call PlayerWarp(n, 5, 8, 8)
to where your jail is Big Grin

and better commend it as 'Warp to Jail

Thanks. I changed the code, to make it easier to understand. Actually just the comment. But like I said, this is just an edit of DarkC's code.
Reply
#4
First off when I just copy and paste the packet it highlights CJailPlayer() and says only comments may be placed after subs and I have it the way you said to. So then I tried turning it into a sub and it worked until If GetPlayerAccess(Index) It highlights index and said variable not defined. And yes I am trying so Robin and others dont freak out I tried to fix it and could not solve it can you give me some insight on this please.

Code:
' ::::::::::::::::::::::
' :: Quit game packet ::
' ::::::::::::::::::::::
Sub HandleQuit(ByVal Index As Long)
    Call CloseSocket(Index)
End Sub

      ' ::::::::::::::::::::::::
        ' :: Jail Player Packet ::
        ' ::::::::::::::::::::::::
       Case CJailPlayer()
        ' Prevent hacking...
        If GetPlayerAccess(Index) < ADMIN_CREATOR Then
            Call HackingAttempt(Index, "Admin Cloning")
        Exit Sub
    End If

n = FindPlayer(Parse(1))

    If n  Index Then
    If n > 0 Then
    'Sends messages out
        Call PlayerMsg(n, "You have been jailed by an admin.", BrightRed)
        Call GlobalMsg(GetPlayerName(n) & " has been jailed by an admin.", BrightRed)
    'Warp to Jail map (Change the coordinates to fit your needs)
        Call PlayerWarp(n, 5, 8, 8)
    Else
        Call PlayerMsg(Index, "Player is not online.", White)
    End If
    Else
        Call PlayerMsg(Index, "You cannot jail yourself!", White)
    End If

Exit Sub
Reply
#5
Are you using MS4?... I don't have the source in front of me so I can't confirm, but this was made to work with the latest MS4. MS 3.0.3 was built differently, to a point where copypasta alone won't work with it.
Reply
#6
Lea Wrote:this tutorial will not work with the latest MSE4 release. Anyone want to update it?

It won't work with the newest release? What changed?
Reply
#7
Download the newest version and test it out.

We changed how packets are handled. They are separated into their own subs.
Reply
#8
Dugor Wrote:Download the newest version and test it out.

We changed how packets are handled. They are separated into their own subs.

Hmm... I see. I haven't been using the latest version, because I don't wanna reprogram all that I have added. This is going to be bothersome. I'll see if I can remake it for the newest version. T_T;
Reply
#9
You should be using the newest version. It's only gonna get better and better.
Reply
#10
Sonire Wrote:You should be using the newest version. It's only gonna get better and better.

True, but what about all the programming I put into the other? I know it's not much, but heres my changelog:

Code:
Things I've changed:

(Sep 19th, 2008)

Admin Panel (F1)
Member Of the Month
Who's Online that Have PK's.
Right click set access, server menu.
Kill and Jail commmands.
@ = Auction Chat

(Sep 20th, 2008)

Swear Filter
Draw NPC Names
Fixed Nullbanlist error
Fixed Moniter spelling error, with Monitor.
Made it so names can't go off screen.

(Sep 21st, 2008)

Changed /warpto, to /warp
Added /advancedinfo feature
Toggle Shift for run.
Fixed /setaccess bug
Programmed in /setlevel feature

It'd be a major pain to reprogram that in.... Then again, it'd improve my skills. Learning how to program it in different ways. I don't know... We'll see.
Reply
#11
Alright, I fixed it so it works with the newest version. All you need to change, is the server side of things. Add this

Code:
' ::::::::::::::::::::::::
            ' :: Jail Player Packet ::
            ' ::::::::::::::::::::::::
Sub HandleJailPlayer(ByVal Index As Long, ByRef Parse() As String)
Dim N

            ' Prevent hacking...
            If GetPlayerAccess(Index) < ADMIN_CREATOR Then
                Call HackingAttempt(Index, "Admin Cloning")
            Exit Sub
        End If

    N = FindPlayer(Parse(1))

        If N  Index Then
        If N > 0 Then
        'Sends messages out
            Call PlayerMsg(N, "You have been jailed by an admin.", BrightRed)
            Call GlobalMsg(GetPlayerName(N) & " has been jailed by an admin.", BrightRed)
        'Warp to Jail map (Change the coordinates to fit your needs)
            Call PlayerWarp(N, 5, 8, 8)
        Else
            Call PlayerMsg(Index, "Player is not online.", White)
        End If
        Else
            Call PlayerMsg(Index, "You cannot jail yourself!", White)
        End If

    End Sub

And find:
Code:
Handlekickplayer index, parse
And under that add:

Code:
Case CJailPlayer
            HandleJailPlayer Index, Parse
Reply
#12
[Image: notfound.jpg]

Help me please ? :\
Reply
#13
Doesn't work with the newest version, I might reprogram it though.
Reply
#14
Alright, thanks for the quick reply , and thanks for letting me know man. Im pretty much new and attempting to learn everything at a slow pace so that I can understand things better but im confused with the tutorial section because there's some tutorials that work and some that don't.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)