diff --git a/Exiled.CustomModules/API/Commands/CustomRoles/Give.cs b/Exiled.CustomModules/API/Commands/CustomRoles/Give.cs index 2630b0780f..ceca249863 100644 --- a/Exiled.CustomModules/API/Commands/CustomRoles/Give.cs +++ b/Exiled.CustomModules/API/Commands/CustomRoles/Give.cs @@ -17,7 +17,6 @@ namespace Exiled.CustomModules.API.Commands.CustomRoles using Exiled.CustomModules.API.Features; using Exiled.CustomModules.API.Features.CustomRoles; using Exiled.Permissions.Extensions; - using RemoteAdmin; /// /// The command to give a role to player(s). @@ -67,17 +66,17 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s if (arguments.Count == 1) { - if (sender is PlayerCommandSender playerCommandSender) - { - Pawn player = Player.Get(playerCommandSender).Cast(); + Pawn player = Player.Get(arguments.At(1)).Cast(); - role.Spawn(player); - response = $"{role.Name} given to {player.Nickname}."; - return true; + if (player is null) + { + response = "Player not found"; + return false; } - response = "Failed to provide a valid player."; - return false; + role.Spawn(player); + response = $"{role.Name} given to {player.Nickname}."; + return true; } string identifier = string.Join(" ", arguments.Skip(1));