v1.0.4
This commit is contained in:
parent
6422436252
commit
714624d96a
45 changed files with 488 additions and 141 deletions
|
|
@ -142,6 +142,7 @@ namespace jRandomSkills
|
|||
public bool DebugMode { get; set; }
|
||||
public string? AlternativeSkillButton { get; set; }
|
||||
public float SkillTimeBeforeStart { get; set; }
|
||||
public float SkillDescriptionDuration { get; set; }
|
||||
public NormalCommand SetSkillCommands { get; set; }
|
||||
public NormalCommand SkillsListCommands { get; set; }
|
||||
public NormalCommand UseSkillCommands { get; set; }
|
||||
|
|
@ -165,6 +166,7 @@ namespace jRandomSkills
|
|||
DebugMode = true;
|
||||
AlternativeSkillButton = null;
|
||||
SkillTimeBeforeStart = 7;
|
||||
SkillDescriptionDuration = 7;
|
||||
|
||||
SetSkillCommands = new NormalCommand("ustawskill, ustaw_skill, setskill, set_skill, definirhabilidade, configurarhabilidade, 设置技能, 配置技能", "@jRandmosSkills/admin");
|
||||
SkillsListCommands = new NormalCommand("supermoc, skille, listamocy, supermoce, skills, listaHabilidades, habilidades, 技能列表, 超能力列表", "@jRandmosSkills/admin");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace jRandomSkills.src.utils
|
||||
|
|
@ -37,7 +38,7 @@ namespace jRandomSkills.src.utils
|
|||
|
||||
var code = Path.GetFileNameWithoutExtension(langPath);
|
||||
var jsonText = File.ReadAllText(langPath);
|
||||
var translations = JsonSerializer.Deserialize<Dictionary<string, string>>(jsonText);
|
||||
var translations = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonText);
|
||||
|
||||
if (translations != null)
|
||||
_translations[code] = translations;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Cvars;
|
||||
using CounterStrikeSharp.API.Modules.Entities;
|
||||
using CounterStrikeSharp.API.Modules.Entities.Constants;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
||||
|
|
@ -69,6 +70,18 @@ namespace jRandomSkills
|
|||
return new Vector(x, y, z);
|
||||
}
|
||||
|
||||
public static void ChangePlayerScale(CCSPlayerController? player, float scale)
|
||||
{
|
||||
if (player == null || !player.IsValid) return;
|
||||
var playerPawn = player.PlayerPawn.Value;
|
||||
if (playerPawn == null || !playerPawn.IsValid || playerPawn.CBodyComponent == null || playerPawn.CBodyComponent.SceneNode == null) return;
|
||||
|
||||
playerPawn.CBodyComponent.SceneNode.Scale = scale;
|
||||
playerPawn.CBodyComponent.SceneNode.GetSkeletonInstance().Scale = scale;
|
||||
playerPawn.AcceptInput("SetScale", null, null, scale.ToString());
|
||||
Server.NextFrame(() => Utilities.SetStateChanged(playerPawn, "CBaseEntity", "m_CBodyComponent"));
|
||||
}
|
||||
|
||||
public static void TakeHealth(CCSPlayerPawn? pawn, int damage)
|
||||
{
|
||||
if (pawn == null || !pawn.IsValid || pawn.LifeState != (byte)LifeState_t.LIFE_ALIVE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue