local ffi = require ("ffi")
ffi.cdef[[
typedef uintptr_t (__thiscall* GetClientEntity_4242425_t)(void*, int);
typedef struct
{
float x;
float y;
float z;
} vec_t;
typedef struct
{
char pad0[0x60]; // 0x00
void* pEntity; // 0x60
void* pActiveWeapon; // 0x64
void* pLastActiveWeapon; // 0x68
float flLastUpdateTime; // 0x6C
int iLastUpdateFrame; // 0x70
float flLastUpdateIncrement; // 0x74
float flEyeYaw; // 0x78
float flEyePitch; // 0x7C
float flGoalFeetYaw; // 0x80
float flLastFeetYaw; // 0x84
float flMoveYaw; // 0x88
float flLastMoveYaw; // 0x8C // changes when moving/jumping/hitting ground
float flLeanAmount; // 0x90
char pad1[0x4]; // 0x94
float flFeetCycle; // 0x98 0 to 1
float flMoveWeight; // 0x9C 0 to 1
float flMoveWeightSmoothed; // 0xA0
float flDuckAmount; // 0xA4
float flHitGroundCycle; // 0xA8
float flRecrouchWeight; // 0xAC
vec_t vecOrigin; // 0xB0
vec_t vecLastOrigin;// 0xBC
vec_t vecVelocity; // 0xC8
vec_t vecVelocityNormalized; // 0xD4
vec_t vecVelocityNormalizedNonZero; // 0xE0
float flVelocityLenght2D; // 0xEC
float flJumpFallVelocity; // 0xF0
float flSpeedNormalized; // 0xF4 // clamped velocity from 0 to 1
float flRunningSpeed; // 0xF8
float flDuckingSpeed; // 0xFC
float flDurationMoving; // 0x100
float flDurationStill; // 0x104
bool bOnGround; // 0x108
bool bHitGroundAnimation; // 0x109
char pad2[0x2]; // 0x10A
float flNextLowerBodyYawUpdateTime; // 0x10C
float flDurationInAir; // 0x110
float flLeftGroundHeight; // 0x114
float flHitGroundWeight; // 0x118 // from 0 to 1, is 1 when standing
float flWalkToRunTransition; // 0x11C // from 0 to 1, doesnt change when walking or crouching, only running
char pad3[0x4]; // 0x120
float flAffectedFraction; // 0x124 // affected while jumping and running, or when just jumping, 0 to 1
char pad4[0x208]; // 0x128
float flMinBodyYaw; // 0x330
float flMaxBodyYaw; // 0x334
float flMinPitch; //0x338
float flMaxPitch; // 0x33C
int iAnimsetVersion; // 0x340
char pad_0000[20];
} CCSGOPlayerAnimationState_534535_t;
]]
local entity_list_ptr = ffi.cast("void***", utils.create_interface("client.dll", "VClientEntityList003"))
local get_client_entity_fn = ffi.cast("GetClientEntity_4242425_t", entity_list_ptr[0][3])
local get_entity_address = function(ent_index)
local addr = get_client_entity_fn(entity_list_ptr, ent_index)
return addr
end
client.add_callback("on_paint", function()
local localplayer = entitylist.get_local_player()
if not localplayer then return end
ffi.cast("CCSGOPlayerAnimationState_534535_t**", get_entity_address(localplayer:get_index()) + 0x9960)[0].flAffectedFraction = 1
end)