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
#2
It's good, but basic. What would be a nice addition, is to make a .ini file or something, that checks to see if hte player has been warned before. If so then it carries, a certain action. Then on the third strike, they get a ban. Nevertheless, a good first tut.
Reply
#3
I'd just add a warning stat to the player.ini and have it check that. Every time you warn them it would increase by one and once it reaches three you'd get kicked or banned.
Reply
#4
You could also use DFAs System Time tut and do things like reducing the players warning level by 1 like every week or 3 days or something.

I've been doing much thinking regarding bans, ban times, and warnings and stuff lately.
Reply
#5
Egon Wrote:I'd just add a warning stat to the player.ini and have it check that. Every time you warn them it would increase by one and once it reaches three you'd get kicked or banned.

What functions would you use? Getvar and putvar?
Reply
#6
Don't forget ability to give a reason for Warning. =-p
Reply
#7
Well first you'd have to use GetVar to make sure they aren't going to match or pass the number for kicking or banning or whatever.. Then PutVar to set the value. It's not all that hard.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)