Skip to content

Commit

Permalink
add option to toggle warday guns
Browse files Browse the repository at this point in the history
  • Loading branch information
destoer committed Dec 27, 2023
1 parent 5b60f8c commit a3a6e23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Jail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class JailConfig : BasePluginConfig
[JsonPropertyName("ct_armour")]
public bool ct_armour { get; set; } = true;

[JsonPropertyName("warday_guns")]
public bool warday_guns { get; set; } = false;

// ratio of t to CT
[JsonPropertyName("bal_guards")]
public int bal_guards { get; set; } = 0;
Expand Down Expand Up @@ -183,8 +186,10 @@ public void OnConfigParsed(JailConfig config)

lr.lr_stats.config = config;
lr.config = config;

warden.config = config;
warden.mute.config = config;
warden.warday.config = config;
JailPlayer.config = config;

lr.lr_config_reload();
Expand Down
11 changes: 8 additions & 3 deletions src/Warden/Warday.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ public bool start_warday(String location, int delay)
JailPlugin.start_event();


foreach(CCSPlayerController player in Utilities.GetPlayers())
if(config.warday_guns)
{
if(player.is_valid() && player.TeamNum == Lib.TEAM_CT)
foreach(CCSPlayerController player in Utilities.GetPlayers())
{
player.event_gun_menu();
if(player.is_valid() && player.TeamNum == Lib.TEAM_CT)
{
player.event_gun_menu();
}
}
}

Expand Down Expand Up @@ -83,6 +86,8 @@ public void map_start()
round_counter = ROUND_LIMIT;
}

public JailConfig config = new JailConfig();

String WARDAY_PREFIX = $" {ChatColors.Green} [Warday]: {ChatColors.White}";

bool warday_active = false;
Expand Down

0 comments on commit a3a6e23

Please sign in to comment.