Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
permissions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus-QC committed Oct 30, 2022
1 parent ca09b14 commit ba74919
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BetterDrops/BetterDrops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BetterDrops : Plugin<PluginConfig>
public override string Author { get; } = "Jesus-QC";
public override string Name { get; } = "BetterDrops";
public override string Prefix { get; } = "better_drops";
public override Version Version { get; } = new Version(2, 0, 1);
public override Version Version { get; } = new Version(2, 0, 2);
public override Version RequiredExiledVersion { get; } = new Version(5, 0, 0);

private EventManager _eventManager;
Expand Down
2 changes: 2 additions & 0 deletions BetterDrops/Commands/BetterDropsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class BetterDropsCommand : ParentCommand
public sealed override void LoadGeneratedCommands()
{
RegisterCommand(SpawnCommand.Instance);
RegisterCommand(ChaosCommand.Instance);
RegisterCommand(MtfCommand.Instance);
}

protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSender sender, out string response)
Expand Down
8 changes: 7 additions & 1 deletion BetterDrops/Commands/ChaosCommand.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using BetterDrops.Features.Extensions;
using CommandSystem;
using Exiled.Permissions.Extensions;

namespace BetterDrops.Commands
{
[CommandHandler(typeof(ClientCommandHandler))]
public class ChaosCommand : ICommand
{
public static ChaosCommand Instance { get; } = new ChaosCommand();
Expand All @@ -15,6 +15,12 @@ public class ChaosCommand : ICommand

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission("bd.spawn"))
{
response = "You don't have perms to do that!";
return false;
}

Team.CHI.SpawnDrops(BetterDrops.PluginConfig.ChaosDropWave, BetterDrops.PluginConfig.ChaosDropWave.NumberOfDrops);

response = "Spawned!";
Expand Down
8 changes: 7 additions & 1 deletion BetterDrops/Commands/MtfCommand.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using BetterDrops.Features.Extensions;
using CommandSystem;
using Exiled.Permissions.Extensions;

namespace BetterDrops.Commands
{
[CommandHandler(typeof(ClientCommandHandler))]
public class MtfCommand : ICommand
{
public static MtfCommand Instance { get; } = new MtfCommand();
Expand All @@ -15,6 +15,12 @@ public class MtfCommand : ICommand

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission("bd.spawn"))
{
response = "You don't have perms to do that!";
return false;
}

Team.MTF.SpawnDrops(BetterDrops.PluginConfig.MtfDropWave, BetterDrops.PluginConfig.MtfDropWave.NumberOfDrops);

response = "Spawned!";
Expand Down
8 changes: 7 additions & 1 deletion BetterDrops/Commands/SpawnCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using BetterDrops.Features.Extensions;
using CommandSystem;
using Exiled.API.Features;
using Exiled.Permissions.Extensions;
using UnityEngine;
using Random = UnityEngine.Random;

namespace BetterDrops.Commands
{
[CommandHandler(typeof(ClientCommandHandler))]
public class SpawnCommand : ICommand
{
public static SpawnCommand Instance { get; } = new SpawnCommand();
Expand All @@ -18,6 +18,12 @@ public class SpawnCommand : ICommand

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission("bd.spawn"))
{
response = "You don't have perms to do that!";
return false;
}

DropExtensions.SpawnDrop(Player.Get(sender).Position + Vector3.up * 10f, Random.ColorHSV(), new [] { ItemType.Coin });

response = "Spawned!";
Expand Down

0 comments on commit ba74919

Please sign in to comment.