Browse Source

Add weapon_silencer, weapon_bloodly_9mmAR and weapon_bloodly_shotgun implementations.

residual_point
Night Owl 7 years ago
parent
commit
a8d0d70fdf
  1. 11
      dlls/glock.cpp
  2. 11
      dlls/mp5.cpp
  3. 11
      dlls/shotgun.cpp
  4. 3
      dlls/weapons.cpp

11
dlls/glock.cpp

@ -236,13 +236,19 @@ class CGlockAmmo : public CBasePlayerAmmo
void Spawn( void ) void Spawn( void )
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/w_9mmclip.mdl" ); if( FClassnameIs( pev, "weapon_silencer" ) )
SET_MODEL( ENT( pev ), "models/w_silencer.mdl" );
else
SET_MODEL( ENT( pev ), "models/w_9mmclip.mdl" );
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void Precache( void ) void Precache( void )
{ {
PRECACHE_MODEL( "models/w_9mmclip.mdl" ); if( FClassnameIs( pev, "weapon_silencer" ) )
PRECACHE_MODEL( "models/w_silencer.mdl" );
else
PRECACHE_MODEL( "models/w_9mmclip.mdl" );
PRECACHE_SOUND( "items/9mmclip1.wav" ); PRECACHE_SOUND( "items/9mmclip1.wav" );
} }
@ -257,5 +263,6 @@ class CGlockAmmo : public CBasePlayerAmmo
} }
}; };
LINK_ENTITY_TO_CLASS( weapon_silencer, CGlockAmmo )
LINK_ENTITY_TO_CLASS( ammo_glockclip, CGlockAmmo ) LINK_ENTITY_TO_CLASS( ammo_glockclip, CGlockAmmo )
LINK_ENTITY_TO_CLASS( ammo_9mmclip, CGlockAmmo ) LINK_ENTITY_TO_CLASS( ammo_9mmclip, CGlockAmmo )

11
dlls/mp5.cpp

@ -281,12 +281,18 @@ class CMP5AmmoClip : public CBasePlayerAmmo
void Spawn( void ) void Spawn( void )
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/w_9mmARclip.mdl" ); if( FClassnameIs( pev, "weapon_bloodly_9mmAR" ) )
SET_MODEL( ENT( pev ), "models/w_bloodly_9mmAR.mdl" );
else
SET_MODEL( ENT( pev ), "models/w_9mmARclip.mdl" );
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void Precache( void ) void Precache( void )
{ {
PRECACHE_MODEL( "models/w_9mmARclip.mdl" ); if( FClassnameIs( pev, "weapon_bloodly_9mmAR" ) )
PRECACHE_MODEL( "models/w_bloodly_9mmAR.mdl" );
else
PRECACHE_MODEL( "models/w_9mmARclip.mdl" );
PRECACHE_SOUND( "items/9mmclip1.wav" ); PRECACHE_SOUND( "items/9mmclip1.wav" );
} }
BOOL AddAmmo( CBaseEntity *pOther ) BOOL AddAmmo( CBaseEntity *pOther )
@ -300,6 +306,7 @@ class CMP5AmmoClip : public CBasePlayerAmmo
} }
}; };
LINK_ENTITY_TO_CLASS( weapon_bloodly_9mmAR, CMP5AmmoClip )
LINK_ENTITY_TO_CLASS( ammo_mp5clip, CMP5AmmoClip ) LINK_ENTITY_TO_CLASS( ammo_mp5clip, CMP5AmmoClip )
LINK_ENTITY_TO_CLASS( ammo_9mmAR, CMP5AmmoClip ) LINK_ENTITY_TO_CLASS( ammo_9mmAR, CMP5AmmoClip )

11
dlls/shotgun.cpp

@ -370,12 +370,18 @@ class CShotgunAmmo : public CBasePlayerAmmo
void Spawn( void ) void Spawn( void )
{ {
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/w_shotbox.mdl" ); if( FClassnameIs( pev, "weapon_bloodly_9mmAR" ) )
SET_MODEL( ENT( pev ), "models/w_bloodly_shotgun.mdl" );
else
SET_MODEL( ENT( pev ), "models/w_shotbox.mdl" );
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void Precache( void ) void Precache( void )
{ {
PRECACHE_MODEL( "models/w_shotbox.mdl" ); if( FClassnameIs( pev, "weapon_bloodly_9mmAR" ) )
PRECACHE_MODEL( "models/w_bloodly_shotgun.mdl" );
else
PRECACHE_MODEL( "models/w_shotbox.mdl" );
PRECACHE_SOUND( "items/9mmclip1.wav" ); PRECACHE_SOUND( "items/9mmclip1.wav" );
} }
BOOL AddAmmo( CBaseEntity *pOther ) BOOL AddAmmo( CBaseEntity *pOther )
@ -389,4 +395,5 @@ class CShotgunAmmo : public CBasePlayerAmmo
} }
}; };
LINK_ENTITY_TO_CLASS( weapon_bloodly_shotgun, CShotgunAmmo )
LINK_ENTITY_TO_CLASS( ammo_buckshot, CShotgunAmmo ) LINK_ENTITY_TO_CLASS( ammo_buckshot, CShotgunAmmo )

3
dlls/weapons.cpp

@ -304,6 +304,7 @@ void W_Precache( void )
// shotgun // shotgun
UTIL_PrecacheOtherWeapon( "weapon_shotgun" ); UTIL_PrecacheOtherWeapon( "weapon_shotgun" );
UTIL_PrecacheOther( "ammo_buckshot" ); UTIL_PrecacheOther( "ammo_buckshot" );
UTIL_PrecacheOther( "weapon_bloodly_shotgun" );
// crowbar // crowbar
UTIL_PrecacheOtherWeapon( "weapon_crowbar" ); UTIL_PrecacheOtherWeapon( "weapon_crowbar" );
@ -311,11 +312,13 @@ void W_Precache( void )
// glock // glock
UTIL_PrecacheOtherWeapon( "weapon_9mmhandgun" ); UTIL_PrecacheOtherWeapon( "weapon_9mmhandgun" );
UTIL_PrecacheOther( "ammo_9mmclip" ); UTIL_PrecacheOther( "ammo_9mmclip" );
UTIL_PrecacheOther( "weapon_silencer" );
// mp5 // mp5
UTIL_PrecacheOtherWeapon( "weapon_9mmAR" ); UTIL_PrecacheOtherWeapon( "weapon_9mmAR" );
UTIL_PrecacheOther( "ammo_9mmAR" ); UTIL_PrecacheOther( "ammo_9mmAR" );
UTIL_PrecacheOther( "ammo_ARgrenades" ); UTIL_PrecacheOther( "ammo_ARgrenades" );
UTIL_PrecacheOther( "weapon_bloodly_9mmAR" );
// 9mm ammo box // 9mm ammo box
UTIL_PrecacheOther( "ammo_9mmbox" ); UTIL_PrecacheOther( "ammo_9mmbox" );

Loading…
Cancel
Save