diff --git a/mod/Jailbreak.LastRequest/LastRequestCommand.cs b/mod/Jailbreak.LastRequest/LastRequestCommand.cs index 54335add..01dd7e70 100644 --- a/mod/Jailbreak.LastRequest/LastRequestCommand.cs +++ b/mod/Jailbreak.LastRequest/LastRequestCommand.cs @@ -65,7 +65,7 @@ public void Command_LastRequest(CCSPlayerController? executor, CommandInfo info) } // Validate LR - LRType? type = LRTypeExtensions.FromString(info.GetArg(1)); + var type = LRTypeExtensions.FromString(info.GetArg(1)); if (type == null) { info.ReplyToCommand("Invalid LR"); @@ -78,6 +78,7 @@ public void Command_LastRequest(CCSPlayerController? executor, CommandInfo info) } var target = info.GetArgTargetResult(2); + new Target(info.GetArg(2)).GetTarget(executor); if (!target.Players.Any()) { info.ReplyToCommand($"Could not find valid player using {info.GetArg(2)}"); diff --git a/mod/Jailbreak.LastRequest/LastRequestFactory.cs b/mod/Jailbreak.LastRequest/LastRequestFactory.cs index dfb4dc91..e2844ff6 100644 --- a/mod/Jailbreak.LastRequest/LastRequestFactory.cs +++ b/mod/Jailbreak.LastRequest/LastRequestFactory.cs @@ -11,7 +11,7 @@ public class LastRequestFactory : ILastRequestFactory public void Start(BasePlugin parent) { - this.plugin = plugin; + plugin = parent; } public AbstractLastRequest CreateLastRequest(CCSPlayerController prisoner, CCSPlayerController guard, LRType type) diff --git a/mod/Jailbreak.LastRequest/LastRequestPlayerSelector.cs b/mod/Jailbreak.LastRequest/LastRequestPlayerSelector.cs index c0810fbb..8303fae9 100644 --- a/mod/Jailbreak.LastRequest/LastRequestPlayerSelector.cs +++ b/mod/Jailbreak.LastRequest/LastRequestPlayerSelector.cs @@ -38,6 +38,6 @@ public CenterHtmlMenu CreateMenu(CCSPlayerController player, LRType lrType) private void OnSelect(CCSPlayerController player, ChatMenuOption option, LRType lr, CCSPlayerController target) { - player.ExecuteClientCommandFromServer("css_lr " + ((int) lr) + " #" + target.Index); + player.ExecuteClientCommandFromServer("css_lr " + ((int) lr) + " #" + target.UserId); } } \ No newline at end of file diff --git a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs index f58c6f87..0726e929 100644 --- a/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs +++ b/mod/Jailbreak.LastRequest/LastRequests/KnifeFight.cs @@ -15,10 +15,10 @@ public KnifeFight(BasePlugin plugin, CCSPlayerController prisoner, CCSPlayerCont public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info) { - if (@event.Userid != prisoner && @event.Userid != guard) + if (@event.Userid.Slot != prisoner.Slot && @event.Userid.Slot != guard.Slot) return HookResult.Continue; - if (@event.Userid == prisoner) + if (@event.Userid.Slot == prisoner.Slot) End(LRResult.GuardWin); else End(LRResult.PrisonerWin);