@@ -31,7 +31,7 @@ public string[] ReplaceTags(string[] input, CCSPlayerController player)
31
31
for ( int i = 0 ; i < input . Length ; i ++ )
32
32
{
33
33
output [ i ] = ReplaceLanguageTags ( input [ i ] ) ;
34
- output [ i ] = ReplaceMessageTags ( output [ i ] , player ) ;
34
+ output [ i ] = ReplaceMessageTags ( output [ i ] , player , false ) ;
35
35
output [ i ] = ReplaceColorTags ( output [ i ] ) ;
36
36
}
37
37
@@ -61,7 +61,7 @@ public string ReplaceLanguageTags(string input)
61
61
return input ;
62
62
}
63
63
}
64
- public string ReplaceMessageTags ( string input , CCSPlayerController player )
64
+ public string ReplaceMessageTags ( string input , CCSPlayerController player , bool safety = true )
65
65
{
66
66
SteamID steamId = new SteamID ( player . SteamID ) ;
67
67
@@ -71,7 +71,6 @@ public string ReplaceMessageTags(string input, CCSPlayerController player)
71
71
{ "{MAP}" , NativeAPI . GetMapName ( ) ?? "<MAP not found>" } ,
72
72
{ "{TIME}" , DateTime . Now . ToString ( "HH:mm:ss" ) ?? "<TIME not found>" } ,
73
73
{ "{DATE}" , DateTime . Now . ToString ( "dd.MM.yyyy" ) ?? "<DATE not found>" } ,
74
- { "{PLAYERNAME}" , player . PlayerName ?? "<PLAYERNAME not found>" } ,
75
74
{ "{USERID}" , player . Slot . ToString ( ) ?? "<USERID not found>" } ,
76
75
{ "{STEAMID2}" , steamId . SteamId2 ?? "<STEAMID2 not found>" } ,
77
76
{ "{STEAMID3}" , steamId . SteamId3 ?? "<STEAMID3 not found>" } ,
@@ -84,6 +83,8 @@ public string ReplaceMessageTags(string input, CCSPlayerController player)
84
83
{ "{PLAYERS}" ,
85
84
Utilities . GetPlayers ( ) . Count ( u => u . PlayerPawn . Value != null && u . PlayerPawn . Value . IsValid ) . ToString ( ) ?? "<PLAYERS not found>" }
86
85
} ;
86
+ if ( ! safety )
87
+ replacements . Add ( "{PLAYERNAME}" , player . PlayerName ?? "<PLAYERNAME not found>" ) ;
87
88
88
89
foreach ( var pair in replacements )
89
90
input = input . Replace ( pair . Key , pair . Value ) ;
0 commit comments