v1.0.3
This commit is contained in:
parent
68776c3382
commit
576cee8cfb
87 changed files with 4957 additions and 1558 deletions
41
jRandomSkills - SRC Files/src/player/skills/QuickShot.cs
Normal file
41
jRandomSkills - SRC Files/src/player/skills/QuickShot.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using jRandomSkills.src.player;
|
||||
using jRandomSkills.src.utils;
|
||||
using static CounterStrikeSharp.API.Core.Listeners;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
||||
namespace jRandomSkills
|
||||
{
|
||||
public class QuickShot : ISkill
|
||||
{
|
||||
private static Skills skillName = Skills.QuickShot;
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
if (Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Active != true)
|
||||
return;
|
||||
|
||||
Utils.RegisterSkill(skillName, "#8a42f5");
|
||||
Instance.RegisterListener<OnTick>(OnTick);
|
||||
}
|
||||
|
||||
private static void OnTick()
|
||||
{
|
||||
foreach (var player in Utilities.GetPlayers())
|
||||
{
|
||||
if (!Instance.IsPlayerValid(player)) continue;
|
||||
var playerInfo = Instance.skillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
|
||||
|
||||
if (playerInfo?.Skill == skillName)
|
||||
{
|
||||
var weapon = player.Pawn.Value.WeaponServices?.ActiveWeapon.Value;
|
||||
if (weapon == null) continue;
|
||||
|
||||
Schema.SetSchemaValue<Int32>(weapon.Handle, "CBasePlayerWeapon", "m_nNextPrimaryAttackTick", Server.TickCount);
|
||||
Schema.SetSchemaValue<Int32>(weapon.Handle, "CBasePlayerWeapon", "m_nNextSecondaryAttackTick", Server.TickCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue