Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- easylua.StartWeapon("weapon_sh_stinger")
- SWEP.Base = "weapon_sh_m4a2"
- SWEP.PrintName = "BANNI Corp. Helix STINGER"
- SWEP.ViewModel = "models/weapons/v_RPG.mdl"
- SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
- SWEP.ViewModelFlip = false
- SWEP.Primary.Sound = "weapons/rocket_ll_shoot.wav"
- SWEP.Primary.ReloadSound = "weapons/sentry_upgrading7.wav"
- SWEP.Primary.Automatic = true
- SWEP.Primary.Delay = 1
- SWEP.Primary.NumShots = 5
- SWEP.Primary.Spread = 20
- SWEP.Primary.ClipSize = 3
- function SWEP:CSShootBullet()
- local ply = self.Owner
- if SERVER then
- local tr = ply:GetEyeTrace()
- local v = ply:GetShootPos()
- v = v + ply:GetForward() * (not short and 1 or 2)
- v = v + ply:GetRight() * 3
- v = v + ply:GetUp() * (not short and 1 or -3)
- local ent = ents.Create("sent_rocket")
- ent.RocketOwner = ply
- ent:SetOwner(ply)
- ent:SetPos(v)
- ent:SetAngles(ply:EyeAngles())
- ent:PhysWake()
- ent:Spawn()
- local phys = ent:GetPhysicsObject()
- phys:EnableGravity(false)
- phys:ApplyForceCenter(ply:GetAimVector() * 10000000 + Vector(0,0,200))
- phys:AddVelocity(ply:GetVelocity())
- end
- ply:RemoveAmmo(0, self.Primary.Ammo)
- self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
- ply:MuzzleFlash()
- ply:SetAnimation(PLAYER_ATTACK1)
- if ply:IsNPC() then return end
- self:SetVar("reloadtimer", CurTime() + 1)
- self:EmitSound("weapons/sentry_upgrading7.wav")
- end
- function SWEP:Reload()
- self:SetIronsights(false)
- -- Already reloading
- if self:GetNetworkedBool("reloading", false) then return end
- -- Start reloading if we can
- if self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then
- self:SetNetworkedBool("reloading", true)
- self:SetVar("reloadtimer", CurTime() + 0.65)
- self:SendWeaponAnim(ACT_VM_RELOAD)
- end
- end
- function SWEP:Think()
- if self.Weapon:GetNetworkedBool("reloading", false) then
- if self:GetVar("reloadtimer", 0) < CurTime() then
- -- Finsished reload -
- if self:Clip1() >= self.Primary.ClipSize or self.Owner:GetAmmoCount(self.Primary.Ammo) <= 0 then
- self:SetNetworkedBool("reloading", false)
- return
- end
- -- Next cycle
- self:SetVar("reloadtimer", CurTime() + 1)
- self:EmitSound("weapons/sentry_upgrading7.wav")
- self:SendWeaponAnim(ACT_VM_RELOAD)
- -- Add ammo
- self.Owner:RemoveAmmo(1, self.Primary.Ammo, false)
- self:SetClip1( self.Weapon:Clip1() + 1)
- -- Finish filling, final pump
- if self.Weapon:Clip1() >= self.Primary.ClipSize or self.Owner:GetAmmoCount(self.Primary.Ammo) <= 0 then
- self:EmitSound("weapons/sniper_railgun_no_fire.wav", 100, math.random(100, 110))
- self:SendWeaponAnim(ACT_SHOTGUN_RELOAD_FINISH)
- end
- end
- end
- end
- easylua.EndWeapon()
Advertisement
Add Comment
Please, Sign In to add comment