Has anyone considered making subs for all the messages the server and client send? I'm thinking about doing it. If you put all the subs into a new module, say modMessages or something, then it'd be much easier to change the messages, and the colors, and even translate to new languages.
I've started on it a little bit:
Code:
' ******************************************
' ** Mirage Source 4 **
' ******************************************
' :::::::::::::::::::::::::
' :: CanAttackPlayer ::
' :::::::::::::::::::::::::
Public Sub PMSafeZone(ByVal Index As Long)
Call PlayerMsg(Index, "This is a safe zone!", BrightRed)
End Sub
Public Sub PMAdminAttack(ByVal Index As Long)
Call PlayerMsg(Index, "You cannot attack any player for thou art an admin!", BrightBlue)
End Sub
Public Sub PMCantAttack1(ByVal Index As Long, ByVal Victim As Long)
Call PlayerMsg(Index, "You cannot attack " & GetPlayerName(Victim) & "!", BrightRed)
End Sub
Public Sub PMCantAttack2(ByVal Index As Long)
Call PlayerMsg(Index, "You are below level 10, you cannot attack another player yet!", BrightRed)
End Sub
Public Sub PMCantAttack3(ByVal Index As Long, ByVal Victim As Long)
Call PlayerMsg(Index, GetPlayerName(Victim) & " is below level 10, you cannot attack this player yet!", BrightRed)
End Sub
' ::::::::::::::::::::::
' :: CanAttackNpc ::
' ::::::::::::::::::::::
Public Sub PMCantAttack4(ByVal Index As Long, ByVal NpcName As String)
Call PlayerMsg(Index, "You cannot attack a " & Trim$(NpcName) & "!", BrightBlue)
End Sub
' :::::::::::::::::::::::::
' :: NpcAttackPlayer ::
' :::::::::::::::::::::::::
Public Sub PMNpcAttack(ByVal Index As Long, ByVal NpcName As String, ByVal Damage As Long)
Call PlayerMsg(Index, "A " & NpcName & " hit you for " & Damage & " hit points.", BrightRed)
End Sub
Public Sub GMPlayerDead1(ByVal Index As Long, ByVal NpcName As String)
Call GlobalMsg(GetPlayerName(Index) & " has been killed by a " & NpcName, BrightRed)
End Sub
Public Sub PMLostExp1(ByVal Index As Long)
Call PlayerMsg(Index, "You lost no experience points.", BrightRed)
End Sub
Public Sub PMLostExp2(ByVal Index As Long, ByVal Exp As Long)
Call PlayerMsg(Index, "You lost " & Exp & " experience points.", BrightRed)
End Sub
' ::::::::::::::::::
' :: BanIndex ::
' ::::::::::::::::::
Public Sub GMPlayerBanned1(ByVal BanPlayerIndex As Long, ByVal BannedByIndex As Long)
Call GlobalMsg(GetPlayerName(BanPlayerIndex) & " has been banned from " & GAME_NAME & " by " & GetPlayerName(BannedByIndex) & "!", White)
End Sub
Public Sub ALPlayerBanned1(ByVal BanPlayerIndex As Long, ByVal BannedByIndex As Long)
Call AddLog(GetPlayerName(BannedByIndex) & " has banned " & GetPlayerName(BanPlayerIndex) & ".", ADMIN_LOG)
End Sub
Public Sub AMPlayerBanned1(ByVal BanPlayerIndex As Long, ByVal BannedByIndex As Long)
Call AlertMsg(BanPlayerIndex, "You have been banned by " & GetPlayerName(BannedByIndex) & "!")
End Sub
' ::::::::::::::::::::::::
' :: ServerBanIndex ::
' ::::::::::::::::::::::::
Public Sub GMPlayerBanned2(ByVal BanPlayerIndex As Long)
Call GlobalMsg(GetPlayerName(BanPlayerIndex) & " has been banned from " & GAME_NAME & " by " & "the Server" & "!", White)
End Sub
Public Sub ALPlayerBanned2(ByVal BanPlayerIndex As Long)
Call AddLog("The Server" & " has banned " & GetPlayerName(BanPlayerIndex) & ".", ADMIN_LOG)
End Sub
Public Sub AMPlayerBanned2(ByVal BanPlayerIndex As Long)
Call AlertMsg(BanPlayerIndex, "You have been banned by " & "The Server" & "!")
End Sub