Okee let''s Start open up mp5.cpp
By
CODE
class CMp5 : public CBasePlayerWeapon
You Must Add the Line
CODE
add int m_fInZoom // This Will Set You That You Can Snipe
Now Go To Secondary Attack Function
And Change All To This
CODE
void CMP5::SecondaryAttack()
{
if (m_fInZoom == 0)
{
m_pPlayer->m_iFOV = 0; // 0 means reset to default fov
m_fInZoom = 1;
}
else if (m_fInZoom == 1)
{
m_pPlayer->m_iFOV = 45; //45 is half of 90
m_fInZoom = 2;
}
else if (m_fInZoom == 2)
{
m_pPlayer->m_iFOV = 10; //10 max zoom
m_fInZoom = 0;
}
pev->nextthink = gpGlobals->time + 0.1;
m_flNextSecondaryAttack = gpGlobals->time + 0.5; //changed to 0.5 for faster cycling
}
We Need To Add A New Function To The Source
CODE
void CMP5::Holster( int skiplocal /* = 0 */ )
{
m_fInReload = FALSE;// cancel any reload in progress.
if ( m_fInZoom )
{
SecondaryAttack( );
}
if (m_fInZoom != 0)
{
m_pPlayer->m_iFOV = 0; // 0 means reset to default fov
m_fInZoom = 1;
}
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.15;
}
Now The Last Thing Find This Lines
CODE
MP5_LONGIDLE = 0,
MP5_IDLE1,
MP5_LAUNCH,
MP5_RELOAD,
MP5_DEPLOY,
MP5_FIRE1,
MP5_FIRE2,
MP5_FIRE3,
And Add This One
MP5_HOLSTER,