Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warn system
#3
Use these functions to Set and Retrieve a players warning level.

Code:
Function GetPlayerWarning(ByVal Index As Long) As Long
    GetPlayerWarning = Player(Index).Char(TempPlayer(Index).CharNum).Warning
End Function

Sub SetPlayerWarning(ByVal Index As Long, ByVal Warning As Byte)
    Player(Index).Char(TempPlayer(Index).CharNum).Warning = Warning
End Sub

Use a text command or something client side to warn a player. The server side packet should have something like:

Code:
Call SetPlayerWarning(Index, GetPlayerWarning(Index) + 1)

Then after that you could use a select case:

Code:
Select Case GetPlayerWarning(Index)
    Case 1
    ' Send them a message alerting them of their first warning

    Case 2
    ' They're second warning, kick them

    Case 3
    ' They're third warning, ban them
End Select

Don't forget to add the proper checks to the packet making sure the player giving the warning is an admin.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)