Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warn Player
#1
Ok this is my first tutorial. This works with the newest version of ms4 so ya. C&P 1 out of 5 to add. This is an edit of NEans Jail command

Client Side

Find
Code:
CGetClasses = 1

Under Add
Code:
CWarnPlayer

Find
Code:
' // Mapper Admin Commands //

Above Add
Code:
' Warn player
                Case "/warn"
                    If GetPlayerAccess(MyIndex) >= ADMIN_CREATOR Then
                        If UBound(Command) >= 1 Then
                            SendData CWarnPlayer & SEP_CHAR & Command(1) & END_CHAR
                        End If
                    End If

Thats all for client

Server side

Find
Code:
CGetClasses = 1

Under Add
Code:
CWarnPlayer

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

Add
Code:
' ::::::::::::::::::::::::
            ' :: Warn Player Packet ::
            ' ::::::::::::::::::::::::
Sub HandleWarnPlayer(ByVal Index As Long, ByRef Parse() As String)
Dim n As Long

            ' 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 Warned by an admin.", BrightRed)
            Call GlobalMsg(GetPlayerName(n) & " has been Warned by an admin.", BrightRed)
        Else
            Call PlayerMsg(Index, "Player is not online.", White)
        End If
        Else
            Call PlayerMsg(Index, "You cannot Warn yourself!", White)
        End If

    End Sub

For admin panel button make a label called btnwarn in it add
Code:
If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then
            Call SendData(CWarnPlayer & SEP_CHAR & txtPlayerAdmin.Text & END_CHAR)
        End If

There you go all done. This warns the player that he is breaking a rule and to stop doing whatever he is doing. Enjoy. Post all comments and criticism here
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)