v1.0.4
This commit is contained in:
parent
a7009be3e0
commit
898f86f888
137 changed files with 3553 additions and 3780 deletions
|
|
@ -1,5 +1,5 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.UserMessages;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using jRandomSkills.src.player;
|
||||
using static jRandomSkills.jRandomSkills;
|
||||
|
|
@ -13,26 +13,24 @@ namespace jRandomSkills
|
|||
public static void LoadSkill()
|
||||
{
|
||||
SkillUtils.RegisterSkill(skillName, Config.GetValue<string>(skillName, "color"));
|
||||
}
|
||||
|
||||
Instance.HookUserMessage(208, um =>
|
||||
{
|
||||
var soundevent = um.ReadUInt("soundevent_hash");
|
||||
var userIndex = um.ReadUInt("source_entity_index");
|
||||
public static void PlayerMakeSound(UserMessage um)
|
||||
{
|
||||
var soundevent = um.ReadUInt("soundevent_hash");
|
||||
var userIndex = um.ReadUInt("source_entity_index");
|
||||
if (userIndex == 0) return;
|
||||
|
||||
if (userIndex == 0) return HookResult.Continue;
|
||||
if (!Instance.footstepSoundEvents.Contains(soundevent) && !Instance.silentSoundEvents.Contains(soundevent))
|
||||
return;
|
||||
|
||||
if (!Instance.footstepSoundEvents.Contains(soundevent) && !Instance.silentSoundEvents.Contains(soundevent))
|
||||
return HookResult.Continue;
|
||||
var player = Utilities.GetPlayers().FirstOrDefault(p => p.Pawn?.Value != null && p.Pawn.Value.IsValid && p.Pawn.Value.Index == userIndex);
|
||||
if (!Instance.IsPlayerValid(player)) return;
|
||||
|
||||
var player = Utilities.GetPlayers().FirstOrDefault(p => p.Pawn?.Value != null && p.Pawn.Value.IsValid && p.Pawn.Value.Index == userIndex);
|
||||
if (!Instance.IsPlayerValid(player)) return HookResult.Continue;
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
|
||||
if (playerInfo?.Skill != skillName) return;
|
||||
|
||||
var playerInfo = Instance.SkillPlayer.FirstOrDefault(p => p.SteamID == player?.SteamID);
|
||||
if (playerInfo?.Skill != skillName) return HookResult.Continue;
|
||||
|
||||
um.Recipients.Clear();
|
||||
return HookResult.Handled;
|
||||
}, HookMode.Pre);
|
||||
um.Recipients.Clear();
|
||||
}
|
||||
|
||||
public class SkillConfig(Skills skill = skillName, bool active = true, string color = "#333333", 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