This commit is contained in:
Juzlus 2025-09-13 01:00:31 +02:00
parent 6422436252
commit 714624d96a
45 changed files with 488 additions and 141 deletions

View file

@ -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)