A фулл кодом какVelocity =< 5
A фулл кодом как
velocity = function(entity)
local velocity = entity.m_vecVelocity
local speed = velocity:length()
return speed
end,
ffi.cdef [[
typedef uintptr_t ( __thiscall* pGetClientEntity )( void *, int );
typedef struct {
char m_chPadding1[ 0x109 ];
bool m_bHitGroundAnimation;
} CPlayerAnimationState_t;
]]
local function GetEntityAddress( iIndex )
local pEntityList = ffi.cast( 'void***', memory.create_interface( 'client.dll', 'VClientEntityList003' ) )
local GetAddressFN = ffi.cast( 'pGetClientEntity', pEntityList[ 0 ][ 3 ] )
return GetAddressFN( pEntityList, iIndex )
end
local function GetAnimationState( pPlayer )
return ffi.cast( 'CPlayerAnimationState_t**', ffi.cast( 'uintptr_t', pPlayer ) + 0x9960 )[ 0 ]
end
function ZeroPitchOnLand(pAntiAims)
local pLocalPlayer = entity_list.get_local_player( )
if pLocalPlayer == nil or not pLocalPlayer:is_alive( ) then
return
end
local pLocalPlayerPtr = GetEntityAddress( pLocalPlayer:get_index( ) )
if pLocalPlayerPtr == nil then
return
end
if GetAnimationState( pLocalPlayerPtr ).m_bHitGroundAnimation then
pAntiAims:set_render_pose( e_poses.BODY_PITCH, 0.65 )
end
end
Может кто ни будь скинуть сурс, чтобы поднялся питч когда ты на земле (в нле)
local m_fFlags = utils.get_netvar_offset("DT_BasePlayer", "m_fFlags")
print(m_fFlags)
(не помню как в луа делается проверка, но в c++: ent->m_fFlags() & FL_ONGROUND)
local lsh = bit.lshift
local FL_ = {
DUCKING = lsh(1,1) -- Player flag -- Player is fully crouched
ANIMDUCKING = lsh(1,2) -- Player flag -- Player is in the process of crouching or uncrouching but could be in transition
-- Fully ducked: FL_.DUCKING and FL_.ANIMDUCKING
-- Previously fully ducked, unducking in progress: FL_.DUCKING and not FL_.ANIMDUCKING
-- Fully unducked: not FL_.DUCKING and not FL_.ANIMDUCKING
-- Previously fully unducked, ducking in progress: not FL_.DUCKING and FL_.ANIMDUCKING
ONGROUND = lsh(1,0) -- At rest / on the ground
WATERJUMP = lsh(1,3) -- player jumping out of water
ONTRAIN = lsh(1,4) -- Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
INRAIN = lsh(1,5) -- Indicates the entity is standing in rain
FROZEN = lsh(1,6) -- Player is frozen for 3rd person camera
ATCONTROLS = lsh(1,7) -- Player can't move, but keeps key inputs for controlling another entity
CLIENT = lsh(1,8) -- Is a player
FAKECLIENT = lsh(1,9) -- Fake client, simulated server side; don't send network messages to them
-- NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though
INWATER = lsh(1,10) -- In water
SWIM = lsh(1,12) -- Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
GODMODE = lsh(1,16)
}
print(bit.band(entity.get_local_player().m_fFlags, FL_.ONGROUND))
Благодарю мужикКод:local lsh = bit.lshift local FL_ = { DUCKING = lsh(1,1) -- Player flag -- Player is fully crouched ANIMDUCKING = lsh(1,2) -- Player flag -- Player is in the process of crouching or uncrouching but could be in transition -- Fully ducked: FL_.DUCKING and FL_.ANIMDUCKING -- Previously fully ducked, unducking in progress: FL_.DUCKING and not FL_.ANIMDUCKING -- Fully unducked: not FL_.DUCKING and not FL_.ANIMDUCKING -- Previously fully unducked, ducking in progress: not FL_.DUCKING and FL_.ANIMDUCKING ONGROUND = lsh(1,0) -- At rest / on the ground WATERJUMP = lsh(1,3) -- player jumping out of water ONTRAIN = lsh(1,4) -- Player is _controlling_ a train, so movement commands should be ignored on client during prediction. INRAIN = lsh(1,5) -- Indicates the entity is standing in rain FROZEN = lsh(1,6) -- Player is frozen for 3rd person camera ATCONTROLS = lsh(1,7) -- Player can't move, but keeps key inputs for controlling another entity CLIENT = lsh(1,8) -- Is a player FAKECLIENT = lsh(1,9) -- Fake client, simulated server side; don't send network messages to them -- NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though INWATER = lsh(1,10) -- In water SWIM = lsh(1,12) -- Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) GODMODE = lsh(1,16) }
Код:print(bit.band(entity.get_local_player().m_fFlags, FL_.ONGROUND))
А если в аирах то как?Animstate->hit_ground_animation
ну, сука, значит наоборот, если не FL_ONGROUNDА если в аирах то как?
print(not bit.band(entity.get_local_player().m_fFlags, FL_.ONGROUND))А если в аирах то как?
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz