feat: add BasePower abstraction

This commit is contained in:
admin
2026-07-26 23:47:38 +02:00
commit 6dbbfc0dde
83 changed files with 7587 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
using CounterStrikeSharp.API.Modules.Utils;
namespace Cs2SuperPowers.Utils;
public static class GrenadeSpawner
{
static MemoryFunctionWithReturn<IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, int, CHEGrenadeProjectile>
CHEGrenadeProjectile_CreateFunc = new(
"55 4C 89 C1 48 89 E5 41 57 49 89 FF 41 56 49 89 D6"
);
public static CBaseCSGrenadeProjectile? CreateGrenade(Vector position, QAngle angle, Vector velocity, CCSPlayerPawn? owner = null)
{
try
{
return CHEGrenadeProjectile_CreateFunc.Invoke(
position.Handle,
angle.Handle,
velocity.Handle,
velocity.Handle,
owner == null ? IntPtr.Zero : owner.Handle,
44
);
}
catch
{
return null;
}
}
}