mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
Added ExecuteOnClient option on custom commands
This commit is contained in:
@@ -22,6 +22,9 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
[JsonPropertyName("Command")]
|
||||
public string Command { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("ExecuteOnClient")]
|
||||
public bool ExecuteOnClient { get; set; } = false;
|
||||
}
|
||||
|
||||
public class CS2_SimpleAdminConfig : BasePluginConfig
|
||||
|
||||
@@ -31,8 +31,14 @@ namespace CS2_SimpleAdmin.Menus
|
||||
bool hasRights = AdminManager.PlayerHasPermissions(admin, customCommand.Flag);
|
||||
if (!hasRights)
|
||||
continue;
|
||||
|
||||
options.Add(new ChatMenuOptionData(customCommand.DisplayName, () => Server.ExecuteCommand(customCommand.Command)));
|
||||
|
||||
options.Add(new ChatMenuOptionData(customCommand.DisplayName, () =>
|
||||
{
|
||||
if (customCommand.ExecuteOnClient)
|
||||
admin.ExecuteClientCommand(customCommand.Command);
|
||||
else
|
||||
Server.ExecuteCommand(customCommand.Command);
|
||||
}));
|
||||
}
|
||||
|
||||
foreach (ChatMenuOptionData menuOptionData in options)
|
||||
|
||||
Reference in New Issue
Block a user