From 74e2a5f12adae52255b6863c7ac47fe0a991fd5e Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:15:00 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::HoldItem(...)` --- saco/game/playerped.cpp | 16 ++++++++++++++++ saco/game/playerped.h | 1 + 2 files changed, 17 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index f3939b7..968bf95 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -941,6 +941,22 @@ BOOL CPlayerPed::HasHandsUp() //----------------------------------------------------------- +void CPlayerPed::HoldItem(int iObject) +{ + if(!m_pPed) return; + if(!IsAdded()) return; + if(!GamePool_Ped_GetAt(m_dwGTAId)) return; + + DWORD dwPed = (DWORD)m_pPed; + _asm push 1 + _asm push iObject + _asm mov ecx, dwPed + _asm mov ebx, 0x5E4390 + _asm call ebx +} + +//----------------------------------------------------------- + void CPlayerPed::StartJetpack() { if(!m_pPed) return; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 444adb8..9c8c8f2 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -99,6 +99,7 @@ public: void HandsUp(); BOOL HasHandsUp(); + void HoldItem(int iObject); float GetAimZ(); void SetAimZ(float fAimZ);