File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed
Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ namespace CustomCommands.Interfaces;
77public interface IPluginUtilities
88{
99 string [ ] SplitStringByCommaOrSemicolon ( string str ) ;
10- void ExecuteServerCommands ( Commands cmd ) ;
10+ void ExecuteServerCommands ( Commands cmd , CCSPlayerController player ) ;
1111 bool RequiresPermissions ( CCSPlayerController player , Permission permissions ) ;
1212}
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ namespace CustomCommands.Services;
1010public class PluginUtilities : IPluginUtilities
1111{
1212 private readonly IPluginGlobals PluginGlobals ;
13+ private readonly IReplaceTagsFunctions ReplaceTagsFunctions ;
1314
14- public PluginUtilities ( IPluginGlobals PluginGlobals )
15+ public PluginUtilities ( IPluginGlobals PluginGlobals , IReplaceTagsFunctions ReplaceTagsFunctions )
1516 {
1617 this . PluginGlobals = PluginGlobals ;
18+ this . ReplaceTagsFunctions = ReplaceTagsFunctions ;
1719 }
1820
1921 public string [ ] SplitStringByCommaOrSemicolon ( string str )
@@ -23,13 +25,13 @@ public string[] SplitStringByCommaOrSemicolon(string str)
2325 . ToArray ( ) ;
2426 }
2527
26- public void ExecuteServerCommands ( Commands cmd )
28+ public void ExecuteServerCommands ( Commands cmd , CCSPlayerController player )
2729 {
2830 if ( cmd . ServerCommands . Count == 0 ) return ;
2931
3032 foreach ( var serverCommand in cmd . ServerCommands )
3133 {
32- Server . ExecuteCommand ( serverCommand ) ;
34+ Server . ExecuteCommand ( ReplaceTagsFunctions . ReplaceMessageTags ( serverCommand , player ) ) ;
3335 }
3436 }
3537 public bool RequiresPermissions ( CCSPlayerController player , Permission permissions )
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public void AddCommands(Commands com)
4141
4242 MessageManager . SendMessage ( player , com ) ;
4343
44- PluginUtilities . ExecuteServerCommands ( com ) ;
44+ PluginUtilities . ExecuteServerCommands ( com , player ) ;
4545 } ) ;
4646 }
4747 }
Original file line number Diff line number Diff line change 4040 " @customcommands/surf"
4141 ]
4242 }
43+ },
44+ {
45+ "Title" : " Kickme" ,
46+ "Description" : " command that kicks yourself" ,
47+ "Command" : " kickme" ,
48+ "Message" : " Getting Kicket" ,
49+ "PrintTo" : 0 ,
50+ "ServerCommands" : [
51+ " kick {PLAYERNAME}" // Tags work for commands as well
52+ ]
4353 }
4454]
You can’t perform that action at this time.
0 commit comments