From fae75bbc87fae03ae6f2f86ca6baaefddc2b5592 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Thu, 3 Sep 2026 02:25:52 +0700 Subject: [PATCH] [saco] Implement/match `CPlayerPed::SetWeaponAmmo`; it writes the slot ammo found by `FindWeaponSlot` --- saco/game/playerped.cpp | 10 ++++++++++ saco/game/playerped.h | 1 + 2 files changed, 11 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 0a2571d..0277ead 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -1300,6 +1300,16 @@ CPlayerPed::~CPlayerPed() //----------------------------------------------------------- +void CPlayerPed::SetWeaponAmmo(BYTE byteWeapon, WORD wAmmo) +{ + if(!m_pPed) return; + + WEAPON_SLOT_TYPE *pSlot = FindWeaponSlot(byteWeapon); + if(pSlot) pSlot->dwAmmo = wAmmo; +} + +//----------------------------------------------------------- + void CPlayerPed::Destroy() { DWORD dwPedPtr = (DWORD)m_pPed; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index efddcd6..72101fb 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -164,6 +164,7 @@ public: void SetShopName(char *szNewShopName); void SetWeaponSkillLevel(int iSkill, WORD wLevel); + void SetWeaponAmmo(BYTE byteWeapon, WORD wAmmo); // .text:100B0080 VECTOR* GetBonePosition(int iBone, VECTOR *vecPos); VECTOR* GetTransformedBonePosition(int iBone, VECTOR *vecOffset);