int CDAViewModel::DrawModel(int flags)
{
	int iReturn = BaseClass::DrawModel(flags);

	C_SDKPlayer* pLocalPlayer = C_SDKPlayer::GetLocalOrSpectatedPlayer();
	if (pLocalPlayer && pLocalPlayer->UseVRHUD())
	{
		Vector vecAmmo1, vecAmmo2;

		int iAmmo1 = LookupAttachment("ammo_1");
		int iAmmo2 = LookupAttachment("ammo_2");
		int iAmmoL1 = LookupAttachment("ammo_1_l");
		int iAmmoL2 = LookupAttachment("ammo_2_l");
		int iAmmoR1 = LookupAttachment("ammo_1_r");
		int iAmmoR2 = LookupAttachment("ammo_2_r");

		if (GetAttachment(iAmmo1, vecAmmo1) && GetAttachment(iAmmo2, vecAmmo2))
			CWeaponSDKBase::DrawVRBullets(vecAmmo1, vecAmmo2, GetActiveWeapon()->Clip1(), GetActiveWeapon()->GetMaxClip1(), true);

		if (GetAttachment(iAmmoR1, vecAmmo1) && GetAttachment(iAmmoR2, vecAmmo2))
		{
			CWeaponSDKBase* pWeapon = dynamic_cast<CWeaponSDKBase*>(GetActiveWeapon());
			if (pWeapon)
				CWeaponSDKBase::DrawVRBullets(vecAmmo1, vecAmmo2, pWeapon->m_iRightClip, pWeapon->GetMaxClip1()/2, true);
		}

		if (GetAttachment(iAmmoL1, vecAmmo1) && GetAttachment(iAmmoL2, vecAmmo2))
		{
			CWeaponSDKBase* pWeapon = dynamic_cast<CWeaponSDKBase*>(GetActiveWeapon());
			if (pWeapon)
				CWeaponSDKBase::DrawVRBullets(vecAmmo1, vecAmmo2, pWeapon->m_iLeftClip, pWeapon->GetMaxClip1()/2, false);
		}
	}

	return iReturn;
}
Esempio n. 2
0
bool PlayerCanReloadConditions( C_SDKPlayer *pPlayer, class CLesson *pLesson )
{
	if (!PlayerAliveConditions(pPlayer, pLesson))
		return false;

	CWeaponSDKBase* pWeapon = pPlayer->GetActiveSDKWeapon();

	if (!pWeapon)
		return false;

	if (!pWeapon->UsesClipsForAmmo1())
		return false;

	if (pWeapon->Clip1() == pWeapon->GetMaxClip1())
		return false;

	return pWeapon->HasPrimaryAmmo();
}