mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement CPlayerPed::HasAmmoForCurrentWeapon()
This commit is contained in:
parent
9894fd3ec7
commit
3e2c80c2b1
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user