From f38ca9f72cd99d9e714990af38a2fec883ed23fd Mon Sep 17 00:00:00 2001 From: destoer Date: Fri, 26 Jan 2024 21:03:45 +0000 Subject: [PATCH] add rebel_cant_lr --- lang/en.json | 4 ++++ src/Jail.cs | 3 +++ src/LastRequest/LastRequest.cs | 7 +++++++ src/Warden/Warden.cs | 5 ++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lang/en.json b/lang/en.json index 7f865e1..40985d1 100644 --- a/lang/en.json +++ b/lang/en.json @@ -11,6 +11,9 @@ "warden.swap_guard_desc": "Expected usage: !swap_guard ", "warden.wsd_command_desc": "!wsd - Call a warden special day", "warden.wsd_ff_command_desc": "!wsd - Call a warden friendly fire special day", + "warden.give_pardon_command_desc": "!give_pardon : pardon a rebel", + "warden.give_freeday_command_desc": "!give_freeday: give a t a freeday", + "warden.colour_command_desc": "!colour : set prisoner colour", "warden.warden_req_alive": "You must be alive to warden", "warden.warden_req_ct": "You must be a CT to warden", "warden.warden_taken": "{0} is already the warden", @@ -130,6 +133,7 @@ "lr.knife_rebel": "{0} is knife a rebel!", "lr.ready": "Last request is available! Type !lr", "lr.wait": "Please wait 15 seconds into the round before starting an lr", + "lr.rebel_cant_lr": "Rebels cannot lr please ask the warden for a pardon", "lr.cancel_lr_cmd": "cancel_lr", "lr.start_lr_cmd": "lr", diff --git a/src/Jail.cs b/src/Jail.cs index 9f908dd..58ac7df 100644 --- a/src/Jail.cs +++ b/src/Jail.cs @@ -87,6 +87,9 @@ public class JailConfig : BasePluginConfig [JsonPropertyName("colour_rebel")] public bool colour_rebel { get; set; } = false; + [JsonPropertyName("rebel_cant_lr")] + public bool rebel_cant_lr { get; set; } = false; + [JsonPropertyName("lr_knife")] public bool lr_knife { get; set; } = true; diff --git a/src/LastRequest/LastRequest.cs b/src/LastRequest/LastRequest.cs index de1b68b..1d0c952 100644 --- a/src/LastRequest/LastRequest.cs +++ b/src/LastRequest/LastRequest.cs @@ -585,6 +585,13 @@ bool can_start_lr(CCSPlayerController? player) { return false; } + + if(JailPlugin.warden.is_alive_rebel(player) && config.rebel_cant_lr) + { + player.localise_prefix(LR_PREFIX,"lr.rebel_cant_lr"); + return false; + } + if(Lib.alive_t_count() > active_lr.Length) { diff --git a/src/Warden/Warden.cs b/src/Warden/Warden.cs index 0170163..6a16df0 100644 --- a/src/Warden/Warden.cs +++ b/src/Warden/Warden.cs @@ -221,7 +221,7 @@ public void give_pardon_callback(CCSPlayerController? invoke, ChatMenuOption opt jail_player?.give_pardon(player); } - bool is_alive_rebel(CCSPlayerController? player) + public bool is_alive_rebel(CCSPlayerController? player) { var jail_player = jail_player_from_player(player); @@ -390,6 +390,9 @@ public void cmd_info(CCSPlayerController? player, CommandInfo command) player.localize("warden.marker_colour_command_desc"); player.localize("warden.wsd_command_desc"); player.localize("warden.wsd_ff_command_desc"); + player.localize("warden.give_pardon_command_desc"); + player.localize("warden.give_freeday_command_desc"); + player.localize("warden.colour_command_desc"); } public void take_warden_cmd(CCSPlayerController? player, CommandInfo command)