v1.1.5
This commit is contained in:
parent
714624d96a
commit
2102f0581f
96 changed files with 1279 additions and 413 deletions
39
jRandomSkills - SRC Files/src/player/skills/Grenadier.cs
Normal file
39
jRandomSkills - SRC Files/src/player/skills/Grenadier.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
||||
namespace jRandomSkills
|
||||
{
|
||||
public class Grenadier : ISkill
|
||||
{
|
||||
private const Skills skillName = Skills.Grenadier;
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
}
|
||||
|
||||
public static void EnableSkill(CCSPlayerController player)
|
||||
{
|
||||
if (!Instance.IsPlayerValid(player)) return;
|
||||
SkillUtils.TryGiveWeapon(player, CsItem.HEGrenade);
|
||||
}
|
||||
|
||||
public static void GrenadeThrown(EventGrenadeThrown @event)
|
||||
{
|
||||
var player = @event.Userid;
|
||||
var weapon = @event.Weapon;
|
||||
if (weapon != "hegrenade" || !Instance.IsPlayerValid(player)) return;
|
||||
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
|
||||
if (playerInfo?.Skill == skillName)
|
||||
player!.GiveNamedItem($"weapon_{weapon}");
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#4a6e21", CsTeam onlyTeam = CsTeam.None, bool needsTeammates = false) : Config.DefaultSkillInfo(skill, active, color, onlyTeam, needsTeammates)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue