v.1.1.7
This commit is contained in:
parent
a36fdbf92d
commit
04a4fdce0d
143 changed files with 3565 additions and 2344 deletions
|
|
@ -4,6 +4,7 @@ using CounterStrikeSharp.API.Modules.Utils;
|
|||
using jRandomSkills.src.player;
|
||||
using jRandomSkills.src.utils;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace jRandomSkills
|
||||
{
|
||||
|
|
@ -13,7 +14,7 @@ namespace jRandomSkills
|
|||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
SkillUtils.RegisterSkill(skillName, SkillsInfo.GetValue<string>(skillName, "color"));
|
||||
}
|
||||
|
||||
public static void NewRound()
|
||||
|
|
@ -33,7 +34,7 @@ namespace jRandomSkills
|
|||
if (playerInfo == null || playerInfo.Skill != skillName) continue;
|
||||
var enemies = Utilities.GetPlayers().Where(p => p.PawnIsAlive && p.Team != player.Team && p.IsValid && !p.IsBot && !p.IsHLTV && p.Team != CsTeam.Spectator && p.Team != CsTeam.None).ToArray();
|
||||
|
||||
HashSet<(string, string)> menuItems = enemies.Select(e => ($"{e.PlayerName} : {e.PawnHealth} HP", e.Index.ToString())).ToHashSet();
|
||||
ConcurrentBag<(string, string)> menuItems = new(enemies.Select(e => ($"{e.PlayerName} : {e.PawnHealth} HP", e.Index.ToString())));
|
||||
SkillUtils.UpdateMenu(player, menuItems);
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +75,7 @@ namespace jRandomSkills
|
|||
var enemies = Utilities.GetPlayers().Where(p => p.PawnIsAlive && p.Team != player.Team && p.IsValid && !p.IsBot && !p.IsHLTV && p.Team != CsTeam.Spectator && p.Team != CsTeam.None).ToArray();
|
||||
if (enemies.Length > 0)
|
||||
{
|
||||
HashSet<(string, string)> menuItems = enemies.Select(e => ($"{e.PlayerName} : {e.PawnHealth} HP", e.Index.ToString())).ToHashSet();
|
||||
ConcurrentBag<(string, string)> menuItems = new(enemies.Select(e => ($"{e.PlayerName} : {e.PawnHealth} HP", e.Index.ToString())));
|
||||
SkillUtils.CreateMenu(player, menuItems);
|
||||
}
|
||||
else
|
||||
|
|
@ -99,7 +100,7 @@ namespace jRandomSkills
|
|||
SkillUtils.CloseMenu(player);
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#a3651a", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#a3651a", CsTeam onlyTeam = CsTeam.None, bool disableOnFreezeTime = false, bool needsTeammates = false) : SkillsInfo.DefaultSkillInfo(skill, active, color, onlyTeam, disableOnFreezeTime, needsTeammates)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue