v1.0.3
This commit is contained in:
parent
68776c3382
commit
576cee8cfb
87 changed files with 4957 additions and 1558 deletions
62
jRandomSkills - SRC Files/src/player/skills/PawelJumper.cs
Normal file
62
jRandomSkills - SRC Files/src/player/skills/PawelJumper.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using static CounterStrikeSharp.API.Core.Listeners;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
||||
namespace jRandomSkills
|
||||
{
|
||||
public class PawelJumper : ISkill
|
||||
{
|
||||
private static Skills skillName = Skills.PawelJumper;
|
||||
private static readonly PlayerFlags[] LF = new PlayerFlags[64];
|
||||
private static readonly int?[] J = new int?[64];
|
||||
private static readonly PlayerButtons[] LB = new PlayerButtons[64];
|
||||
|
||||
public static void LoadSkill()
|
||||
{
|
||||
if (Config.config.SkillsInfo.FirstOrDefault(s => s.Name == skillName.ToString())?.Active != true)
|
||||
return;
|
||||
|
||||
Utils.RegisterSkill(skillName, "#FFA500");
|
||||
|
||||
Instance.RegisterListener<OnTick>(() =>
|
||||
{
|
||||
foreach (var player in Utilities.GetPlayers())
|
||||
{
|
||||
if (!Instance.IsPlayerValid(player)) return;
|
||||
var playerInfo = Instance.skillPlayer.FirstOrDefault(p => p.SteamID == player.SteamID);
|
||||
if (playerInfo?.Skill == skillName)
|
||||
{
|
||||
GiveAdditionalJump(player);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void GiveAdditionalJump(CCSPlayerController player)
|
||||
{
|
||||
var playerPawn = player.PlayerPawn.Value;
|
||||
var flags = (PlayerFlags)playerPawn.Flags;
|
||||
var buttons = player.Buttons;
|
||||
|
||||
if ((LF[player.Slot] & PlayerFlags.FL_ONGROUND) != 0 && (flags & PlayerFlags.FL_ONGROUND) == 0 && (LB[player.Slot] & PlayerButtons.Jump) == 0 && (buttons & PlayerButtons.Jump) != 0)
|
||||
{
|
||||
//J[player.Slot] ++;
|
||||
}
|
||||
else if ((flags & PlayerFlags.FL_ONGROUND) != 0)
|
||||
{
|
||||
J[player.Slot] = 0;
|
||||
}
|
||||
else if ((LB[player.Slot] & PlayerButtons.Jump) == 0 && (buttons & PlayerButtons.Jump) != 0 && J[player.Slot] < 1)
|
||||
{
|
||||
J[player.Slot] ++;
|
||||
playerPawn.AbsVelocity.Z = 300;
|
||||
}
|
||||
|
||||
LF[player.Slot] = flags;
|
||||
LB[player.Slot] = buttons;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue