GAMES CHEATS GUIs SCRIPTS MAPS TUTORIALS SOUNDS TOOLS SERVERS SKINS TEXTURES MODELS PLUGINS MODS
 
Rating
Based on GVME Community!
Rating:


Your rating: N/A
Total votes: 0

You cannot rating yet!
You can rate anything - when you add rating to a submission your vote determines its success or failure.

To vote on this submission
register or login

You cannot add to Favorites!
Total Favorites

You cannot say thanks!
You must register or login

Statistics
Scores and popularity
Views: 1236
Downloads: 20
Feedback: 0

3 Mode Zoom For Mp5

Share: F F F F F F F
  Added by: exeqtR
  Category: GoldSource Engine > Programming
Difficulty Level: Begginer
  Tags: Mode Zoom Mp5
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,
  Added: Jan 15 2021, 12:16 AM    Modified: Never edited!    Thanks List: [+]      
Add Feedback

You cannot post yet!
Get involved on GVME by posting your thoughts. Give authors your feedback to help them develop.

To post in this submission register or login
Feedback