mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-10-18 04:47:04 +02:00
Moved custom commands to its specific menu
This commit is contained in:
parent
cce265c6b7
commit
ac940259f7
3 changed files with 53 additions and 14 deletions
|
|
@ -1,4 +1,3 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Menu;
|
||||
|
|
@ -35,19 +34,6 @@ namespace CS2_SimpleAdmin.Menus
|
|||
|
||||
options.Add(new ChatMenuOptionData("Restart Game", () => CS2_SimpleAdmin.RestartGame(admin)));
|
||||
|
||||
List<CustomServerCommandData> customCommands = CS2_SimpleAdmin.Instance.Config.CustomServerCommands;
|
||||
foreach (CustomServerCommandData customCommand in customCommands)
|
||||
{
|
||||
if (string.IsNullOrEmpty(customCommand.DisplayName) || string.IsNullOrEmpty(customCommand.Command))
|
||||
continue;
|
||||
|
||||
bool hasRights = AdminManager.PlayerHasPermissions(admin, customCommand.Flag);
|
||||
if (!hasRights)
|
||||
continue;
|
||||
|
||||
options.Add(new ChatMenuOptionData(customCommand.DisplayName, () => Server.ExecuteCommand(customCommand.Command)));
|
||||
}
|
||||
|
||||
foreach (ChatMenuOptionData menuOptionData in options)
|
||||
{
|
||||
string menuName = menuOptionData.name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue