Skip to content

Commit 93f4805

Browse files
Update CommandEvents.cs
1 parent e865ceb commit 93f4805

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Code/Plugin/CommandEvents.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using LabApi.Events.Handlers;
44
using LabApi.Features.Enums;
55
using LabApi.Features.Permissions;
6-
using LabApi.Features.Wrappers;
76
using SER.Code.Helpers.Extensions;
87
using SER.Code.Plugin.Commands;
98
using SER.Code.ScriptSystem;
@@ -27,14 +26,14 @@ public static void CaptureComamnd(CommandExecutingEventArgs ev)
2726
{
2827
UsedCommandTypes[ev.Sender] = ev.CommandType;
2928

30-
if (MainPlugin.Instance.Config?.SerMethodsAsCommands != true)
29+
if (MainPlugin.Instance.Config?.MethodCommandPrefix is not true)
3130
{
3231
return;
3332
}
3433

35-
if (Player.Get(ev.Sender) is { } player && player.HasPermissions(MethodCommand.RunPermission))
34+
if (!ev.Sender.HasPermissions(MethodCommand.RunPermission))
3635
{
37-
return ;
36+
return;
3837
}
3938

4039
if (!ev.CommandName.StartsWith(">"))
@@ -72,6 +71,7 @@ public static void CaptureComamnd(CommandExecutingEventArgs ev)
7271
return;
7372
}
7473

74+
ev.Sender.Respond($"Running method '{methodName}'!");
7575
ev.IsAllowed = false;
7676
script.Run();
7777
}

0 commit comments

Comments
 (0)