CapsAdmin

Untitled

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