Advertisement
KishgalYS

mp_weapon_smart_pistol.nut

Sep 12th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.47 KB | None | 0 0
  1.  
  2. // sets the RSPN-101 color to blue, remove when using different model
  3. self.SetWeaponSkin( 2 )
  4.  
  5. //==================================================================================================
  6.  
  7. function SmartSniperPrecache()
  8. {
  9.     if ( WeaponIsPrecached( self ) )
  10.         return
  11.  
  12.     PrecacheParticleSystem( "wpn_mflash_40mm_smoke_side_FP" )
  13.     PrecacheParticleSystem( "wpn_mflash_40mm_smoke_side" )
  14.  
  15.     if ( IsServer() )
  16.     {
  17.         PrecacheModel( TITAN_40MM_SHELL_EJECT )
  18.  
  19.         PrecacheEntity( "crossbow_bolt" )
  20.     }
  21. }
  22. SmartSniperPrecache()
  23.  
  24. function OnWeaponActivate( activateParams )
  25. {
  26.     //old usage
  27.     //SmartAmmo_SetEffectiveRange( self, 100, 5000 )
  28.     //SmartAmmo_SetDotLimitActive( self, 0.994 )
  29.     //SmartAmmo_SetTargetTitans( self, false )
  30.     //SmartAmmo_Start( self, true )
  31. }
  32.  
  33. function OnWeaponDeactivate( deactivateParams )
  34. {
  35.     SmartAmmo_Stop( self )
  36. }
  37.  
  38. function OnClientAnimEvent( name )
  39. {
  40.     if ( name == "muzzle_flash" )
  41.         self.PlayWeaponEffect( "wpn_muzzleflash_pistol_FP", "wpn_muzzleflash_pistol", "muzzle_flash" )
  42.  
  43.     if ( name == "shell_eject" )
  44.         self.PlayWeaponEffect( "wpn_shelleject_pistol_FP", "wpn_shelleject_pistol", "shell" )
  45. }
  46.  
  47. function OnWeaponPrimaryAttack( attackParams )
  48. {
  49.     return SmartAmmo_FireWeapon( self, attackParams )
  50. }
  51.  
  52. function OnWeaponNpcPrimaryAttack( attackParams )
  53. {
  54.     PlayWeaponSound( "Weapon_XO16.Single" )
  55.     self.EmitWeaponNpcSound( LOUD_WEAPON_AI_SOUND_RADIUS, 0.2 )
  56.     self.FireWeaponBullet( attackParams.pos, attackParams.dir, 1, 0 )
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement