CapsAdmin

Untitled

Nov 1st, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. easylua.StartWeapon("mortarbanni")
  2.  
  3. SWEP.Base = "weapon_sh_scout"
  4. SWEP.ViewModel = "models/weapons/v_rpg.mdl"
  5. SWEP.ViewModelFlip = false
  6. SWEP.Primary.Sound = "/weapons/flare_detonator_explode.wav"
  7.  
  8. function SWEP:CSShootBullet()
  9.  
  10.         if SERVER then
  11.             local tr = self.Owner:GetEyeTrace()
  12.  
  13.             local v = self.Owner:GetShootPos()
  14.             v = v + self.Owner:GetForward() * (!short and 1 or 2)
  15.             v = v + self.Owner:GetRight() * 3
  16.             v = v + self.Owner:GetUp() * (!short and 100 or -300)
  17.        
  18.             local ent = ents.Create( "sent_rocket" )
  19.            
  20.             ent:SetPos( v )
  21.             ent:SetOwner( self.Owner )
  22.             ent:SetAngles(self.Owner:EyeAngles())
  23.             ent.RocketOwner = self.Owner
  24.             ent:Spawn()
  25.  
  26.             timer.Simple(1, function()
  27.                 if ent:IsValid() then
  28.                     local phys = ent:GetPhysicsObject()
  29.                     phys:ApplyForceCenter( self.Owner:GetAimVector() * 10000000000000 + Vector(0,0,200) )
  30.                     --phys:SetVelocity( phys:GetVelocity() + self.Owner:GetVelocity() )
  31.                     phys:EnableGravity(true)
  32.                 end
  33.             end)
  34.            
  35.         end
  36.         if ( self.Owner:IsNPC() ) then return end
  37.        
  38.         self.Owner:RemoveAmmo( 0, self.Primary.Ammo )
  39.  
  40.         self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )      // View model animation
  41.         self.Owner:MuzzleFlash()                                // Crappy muzzle light
  42.         self.Owner:SetAnimation( PLAYER_ATTACK1 )               // 3rd Person Animation
  43.        
  44. end
  45.  
  46. easylua.EndWeapon()
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment