Updates & Fixes

# Updates & Fixes
- New Commands: Added `!health` and `!plantedbomb` for testing and server management.
- Config: Client commands are now fully registerable via configuration files.
- Jester (Rework):
    - Refactored from a global mode to a per-player system.
    - Improved timer logic to prevent crashes during round resets.
    - Added special handling for bomb planting and defusing.
- SkillUtils: `AddHealth` now supports an optional `maxHealth` parameter.
- KillerFlash, LongKnife & LongZeus: Added `friendlyFire` options to skill configs.
This commit is contained in:
Juzlus 2026-04-03 04:09:30 +02:00
parent 97887118bf
commit 8634665983
12 changed files with 219 additions and 62 deletions

View file

@ -1,4 +1,5 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Commands.Targeting;
using CounterStrikeSharp.API.Modules.Entities.Constants;
using CounterStrikeSharp.API.Modules.Utils;
using src.utils;
@ -24,6 +25,8 @@ namespace src.player.skills
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
var attackerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == attacker?.SteamID);
if (!SkillsInfo.GetValue<bool>(skillName, "friendlyFire") && player!.Team == attacker!.Team) return;
if (attackerInfo?.Skill == skillName && playerInfo?.Skill != Skills.AntyFlash && player!.PlayerPawn.Value!.FlashDuration >= SkillsInfo.GetValue<float>(skillName, "flashDuration"))
player?.PlayerPawn?.Value?.CommitSuicide(false, true);
}
@ -33,9 +36,10 @@ namespace src.player.skills
SkillUtils.TryGiveWeapon(player, CsItem.FlashbangGrenade);
}
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#57bcff", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = false, bool needsTeammates = false, string requiredPermission = "", float flashDuration = 1f) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission)
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#57bcff", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = false, bool needsTeammates = false, string requiredPermission = "", float flashDuration = 1f, bool friendlyFire = true) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates, requiredPermission)
{
public float FlashDuration { get; set; } = flashDuration;
public bool FriendlyFire { get; set; } = friendlyFire;
}
}
}