mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Implement CPlayerPed::HasAmmoForCurrentWeapon()
This commit is contained in:
1 parent
9894fd3ec7
commit
3e2c80c2b1
2 files changed
+19
No files matched your search
@@ -133,6 +133,24 @@ WEAPON_SLOT_TYPE * CPlayerPed::GetCurrentWeaponSlot()
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
BOOL CPlayerPed::HasAmmoForCurrentWeapon()
|
||||
{
|
||||
if(m_pPed) {
|
||||
WEAPON_SLOT_TYPE * WeaponSlot = GetCurrentWeaponSlot();
|
||||
|
||||
if(!WeaponSlot) return TRUE;
|
||||
|
||||
// Melee types always have ammo.
|
||||
if( WeaponSlot->dwType <= WEAPON_CANE ||
|
||||
WeaponSlot->dwType == WEAPON_PARACHUTE ) return TRUE;
|
||||
|
||||
if(!WeaponSlot->dwAmmo) return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
WORD CPlayerPed::GetAmmo()
|
||||
{
|
||||
if(m_pPed) {
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
void SetArmedWeapon(int iWeaponType, bool bUnk);
|
||||
WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();
|
||||
WEAPON_SLOT_TYPE * FindWeaponSlot(DWORD dwWeapon);
|
||||
BOOL HasAmmoForCurrentWeapon();
|
||||
|
||||
void StartGoggles();
|
||||
void StopGoggles();
|
||||
|
||||
Reference in new issue
Block a user