@@ -31,7 +31,7 @@ public string[] ReplaceTags(string[] input, CCSPlayerController player)
3131 for ( int i = 0 ; i < input . Length ; i ++ )
3232 {
3333 output [ i ] = ReplaceLanguageTags ( input [ i ] ) ;
34- output [ i ] = ReplaceMessageTags ( output [ i ] , player ) ;
34+ output [ i ] = ReplaceMessageTags ( output [ i ] , player , false ) ;
3535 output [ i ] = ReplaceColorTags ( output [ i ] ) ;
3636 }
3737
@@ -61,7 +61,7 @@ public string ReplaceLanguageTags(string input)
6161 return input ;
6262 }
6363 }
64- public string ReplaceMessageTags ( string input , CCSPlayerController player )
64+ public string ReplaceMessageTags ( string input , CCSPlayerController player , bool safety = true )
6565 {
6666 SteamID steamId = new SteamID ( player . SteamID ) ;
6767
@@ -71,7 +71,6 @@ public string ReplaceMessageTags(string input, CCSPlayerController player)
7171 { "{MAP}" , NativeAPI . GetMapName ( ) ?? "<MAP not found>" } ,
7272 { "{TIME}" , DateTime . Now . ToString ( "HH:mm:ss" ) ?? "<TIME not found>" } ,
7373 { "{DATE}" , DateTime . Now . ToString ( "dd.MM.yyyy" ) ?? "<DATE not found>" } ,
74- { "{PLAYERNAME}" , player . PlayerName ?? "<PLAYERNAME not found>" } ,
7574 { "{USERID}" , player . Slot . ToString ( ) ?? "<USERID not found>" } ,
7675 { "{STEAMID2}" , steamId . SteamId2 ?? "<STEAMID2 not found>" } ,
7776 { "{STEAMID3}" , steamId . SteamId3 ?? "<STEAMID3 not found>" } ,
@@ -84,6 +83,8 @@ public string ReplaceMessageTags(string input, CCSPlayerController player)
8483 { "{PLAYERS}" ,
8584 Utilities . GetPlayers ( ) . Count ( u => u . PlayerPawn . Value != null && u . PlayerPawn . Value . IsValid ) . ToString ( ) ?? "<PLAYERS not found>" }
8685 } ;
86+ if ( ! safety )
87+ replacements . Add ( "{PLAYERNAME}" , player . PlayerName ?? "<PLAYERNAME not found>" ) ;
8788
8889 foreach ( var pair in replacements )
8990 input = input . Replace ( pair . Key , pair . Value ) ;
0 commit comments