Skip to content

Commit

Permalink
v0.7.0 | feat: Rethrow in prac and much more
Browse files Browse the repository at this point in the history
  • Loading branch information
shobhit-pathak committed Feb 10, 2024
1 parent d2556d6 commit 8ec0927
Show file tree
Hide file tree
Showing 17 changed files with 1,124 additions and 278 deletions.
25 changes: 25 additions & 0 deletions ConfigConvars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,30 @@ public void MatchZyAutoStartConvar(CCSPlayerController? player, CommandInfo comm

}

[ConsoleCommand("matchzy_allow_force_ready", "Whether force ready using !forceready is enabled or not (Currently works in Match Setup only). Default value: True")]
[ConsoleCommand("get5_allow_force_ready", "Whether force ready using !forceready is enabled or not (Currently works in Match Setup only). Default value: True")]
public void MatchZyAllowForceReadyConvar(CCSPlayerController? player, CommandInfo command)
{
if (player != null) return;
string args = command.ArgString;

allowForceReady = bool.TryParse(args, out bool allowForceReadyValue) ? allowForceReadyValue : args != "0" && allowForceReady;
}

[ConsoleCommand("matchzy_max_saved_last_grenades", "Maximum number of grenade history that may be saved per-map, per-client. Set to 0 to disable. Default value: 512")]
public void MatchZyMaxSavedLastGrenadesConvar(CCSPlayerController? player, CommandInfo command)
{
if (player != null) return;
string args = command.ArgString;

if (int.TryParse(args, out int maxLastGrenadesSavedLimitValue))
{
maxLastGrenadesSavedLimit = maxLastGrenadesSavedLimitValue;
}
else
{
command.ReplyToCommand("Usage: matchzy_max_saved_last_grenades <number>");
}
}
}
}
4 changes: 3 additions & 1 deletion ConsoleCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void OnTacCommand(CCSPlayerController? player, CommandInfo? command) {

[ConsoleCommand("css_roundknife", "Toggles knife round for the match")]
[ConsoleCommand("css_rk", "Toggles knife round for the match")]
public void OnKifeCommand(CCSPlayerController? player, CommandInfo? command) {
public void OnKnifeCommand(CCSPlayerController? player, CommandInfo? command) {
if (IsPlayerAdmin(player, "css_roundknife", "@css/config")) {
isKnifeRequired = !isKnifeRequired;
string knifeStatus = isKnifeRequired ? "Enabled" : "Disabled";
Expand Down Expand Up @@ -324,8 +324,10 @@ private void OnMapReloadCommand(CCSPlayerController? player, CommandInfo? comman
}
string currentMapName = Server.MapName;
if (long.TryParse(currentMapName, out _)) { // Check if mapName is a long for workshop map ids
Server.ExecuteCommand($"bot_kick");
Server.ExecuteCommand($"host_workshop_map \"{currentMapName}\"");
} else if (Server.IsMapValid(currentMapName)) {
Server.ExecuteCommand($"bot_kick");
Server.ExecuteCommand($"changelevel \"{currentMapName}\"");
} else {
ReplyToUserCommand(player, "Invalid map name!");
Expand Down
24 changes: 24 additions & 0 deletions Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace MatchZy;

class Constants
{
public static readonly Dictionary<string, string> ProjectileTypeMap =
new(StringComparer.OrdinalIgnoreCase)
{
{ "smokegrenade_projectile", "smoke" },
{ "flashbang_projectile", "flash" },
{ "hegrenade_projectile", "hegrenade" },
{ "decoy_projectile", "decoy" },
{ "molotov_projectile", "molotov" }
};

public static readonly Dictionary<string, string> NadeProjectileMap =
new(StringComparer.OrdinalIgnoreCase)
{
{ "smoke", "smokegrenade_projectile" },
{ "flash", "flashbang_projectile" },
{ "hegrenade", "hegrenade_projectile" },
{ "decoy", "decoy_projectile" },
{ "molotov", "molotov_projectile" }
};
}
Loading

0 comments on commit 8ec0927

Please sign in to comment.