Find
Code:
CQuit
Under it add:
Code:
CSetWarn
Then Find:
Code:
Sub SetPlayerPK(ByVal Index As Long, ByVal PK As Long)
Player(Index).Char(TempPlayer(Index).CharNum).PK = PK
End Sub
Under it add:
Code:
Function GetPlayerWarn(ByVal Index As Long) As Long
GetPlayerWarn = Player(Index).Char(TempPlayer(Index).CharNum).Warn
End Function
Sub SetPlayerWarn(ByVal Index As Long, ByVal Warn As Long)
Player(Index).Char(TempPlayer(Index).CharNum).Warn = Warn
End Sub
Then Find
Code:
Case Else
GoTo ErrorHandle ' packet not found
Above it add:
Code:
Case CSetWarn
HandleSetWarn Index, Parse
Then Find:
Code:
' :::::::::::::::::::::::
' :: Set sprite packet ::
' :::::::::::::::::::::::
Private Sub HandleSetSprite(ByVal Index As Long, ByRef Parse() As String)
Dim N As Long
' Prevent hacking
If GetPlayerAccess(Index) < ADMIN_MAPPER Then
Call HackingAttempt(Index, "Admin Cloning")
Exit Sub
End If
' The sprite
N = CLng(Parse(1))
Call SetPlayerSprite(Index, N)
Call SendPlayerData(Index)
Exit Sub
End Sub
And under that add:
Code:
' :::::::::::::::::::::::
' :: Set Warn packet ::
' :::::::::::::::::::::::
Sub HandleSetWarn(ByVal Index As Long, _
ByRef Parse() As String)
Dim N As Long
N = FindPlayer(Parse(1))
If N > 0 Then
If N <> Index Then
Select Case GetPlayerWarn(N) + 1
Case 1
Call SetPlayerWarn(N, 1)
'Call SetPlayerWarn(n, GetPlayerWarn(n) + 1)
Call PlayerMsg(Index, "You have received your first warning, for breaking the rules. Your second will result in a kick!", Blue)
Case 2
Call SetPlayerWarn(N, GetPlayerWarn(N) + 1)
Call AlertMsg(Index, "You have received your second warning. Your third will result in a ban")
Case 3
Call SetPlayerWarn(N, GetPlayerWarn(N) + 1)
Call BanIndex(N, Index)
End Select
Else
Call PlayerMsg(Index, "You can't warn yourself!", BrightRed)
End If
Else
Call PlayerMsg(Index, "Player Isn't Online!", BrightRed)
End If
End Sub
Then in the player rec find:
Code:
PK As Byte
Under that add:
Code:
Warn As Byte