From 75d5dcc38d502018488264422ac7c834369adb19 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:11:37 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::SetAimZ(...)` --- saco/game/playerped.cpp | 13 +++++++++++++ saco/game/playerped.h | 1 + 2 files changed, 14 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 766d191..e5f9702 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -900,3 +900,16 @@ float CPlayerPed::GetAimZ() //----------------------------------------------------------- +void CPlayerPed::SetAimZ(float fAimZ) +{ + if(_isnan(fAimZ) || (fAimZ > 100.0f || fAimZ < -100.0f)) return; + + if(m_pPed) { + DWORD dwPlayerInfo = m_pPed->dwPlayerInfoOffset; + _asm mov eax, dwPlayerInfo + _asm mov ebx, fAimZ + _asm mov [eax+84], ebx + } +} + +//----------------------------------------------------------- diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 9656e2f..7ece363 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -88,6 +88,7 @@ public: //char _gap0[741]; int field_48; float GetAimZ(); + void SetAimZ(float fAimZ); int field_4C[10]; struc_97 field_74[10];