This commit is contained in:
Juzlus 2025-09-12 02:24:04 +02:00
parent a7009be3e0
commit 898f86f888
137 changed files with 3553 additions and 3780 deletions

View file

@ -14,21 +14,19 @@ namespace jRandomSkills
public static void LoadSkill()
{
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
}
Instance.RegisterEventHandler<EventBombPlanted>((@event, info) =>
{
var player = @event.Userid;
if (!Instance.IsPlayerValid(player)) return HookResult.Continue;
public static void BombPlanted(EventBombPlanted @event)
{
var player = @event.Userid;
if (!Instance.IsPlayerValid(player)) return;
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
if (playerInfo?.Skill != skillName) return HookResult.Continue;
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
if (playerInfo?.Skill != skillName) return;
var plantedBomb = Utilities.FindAllEntitiesByDesignerName<CPlantedC4>("planted_c4").FirstOrDefault();
if (plantedBomb != null)
Server.NextFrame(() => plantedBomb.C4Blow = (float)Server.EngineTime + detonationTime);
return HookResult.Continue;
});
var plantedBomb = Utilities.FindAllEntitiesByDesignerName<CPlantedC4>("planted_c4").FirstOrDefault();
if (plantedBomb != null)
Server.NextFrame(() => plantedBomb.C4Blow = (float)Server.EngineTime + detonationTime);
}
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#f5b74c", CsTeam onlyTeam = CsTeam.Terrorist, bool needsTeammates = false, int detonationTime = 20) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)