diff --git a/saco/game/common.h b/saco/game/common.h index f36ef8a..0830fa9 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -74,7 +74,12 @@ typedef struct _WEAPON_SLOT_TYPE #pragma pack(1) typedef struct _PED_TASKS_TYPE { - char _gap0[16]; + char _gap0[4]; + + // Basic Tasks + DWORD * pdwDamage; + + char _gap8[8]; DWORD * pdwJumpJetPack; diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index dfb2f84..a32fa30 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -979,6 +979,17 @@ BOOL CPlayerPed::IsFighting() //----------------------------------------------------------- +BOOL CPlayerPed::IsFalling() +{ + if(m_pPed && !IN_VEHICLE(m_pPed) && m_pPed->Tasks->pdwDamage) + { + return GetTaskTypeFromTask(m_pPed->Tasks->pdwDamage) == 208; + } + return FALSE; +} + +//----------------------------------------------------------- + void CPlayerPed::StartJetpack() { if(!m_pPed) return; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index e3c9e8a..0c24b86 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -110,6 +110,7 @@ public: BOOL IsJumping(); BOOL IsFighting(); + BOOL IsFalling(); float GetAimZ(); void SetAimZ(float fAimZ);