[saco] Implement CPlayerPed::GetCurrentWeaponSlot()

This commit is contained in:
RD42 2024-05-03 21:56:41 +08:00
parent 8f763d8f30
commit d20bd16a24
3 changed files with 15 additions and 0 deletions

View File

@ -95,6 +95,10 @@ typedef struct _PED_TYPE
WEAPON_SLOT_TYPE WeaponSlots[13]; // 1440-1804
char _gap70C[12];
BYTE byteCurWeaponSlot; // 1816-1817
} PED_TYPE;
//-----------------------------------------------------------

View File

@ -46,6 +46,16 @@ CPlayerPed::CPlayerPed()
//-----------------------------------------------------------
WEAPON_SLOT_TYPE * CPlayerPed::GetCurrentWeaponSlot()
{
if(m_pPed) {
return &m_pPed->WeaponSlots[m_pPed->byteCurWeaponSlot];
}
return NULL;
}
//-----------------------------------------------------------
WEAPON_SLOT_TYPE * CPlayerPed::FindWeaponSlot(DWORD dwWeapon)
{
if (m_pPed)

View File

@ -14,6 +14,7 @@ class CPlayerPed : public CEntity
{
public:
WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();
WEAPON_SLOT_TYPE * FindWeaponSlot(DWORD dwWeapon);
void StopGoggles();