Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SWEP:ShootBullet(damage, recoil, num_bullets, aimcone)
- num_bullets = num_bullets or 1
- aimcone = aimcone or 0
- self:ShootEffects()
- if self.Tracer == 1 then
- TracerName = "Ar2Tracer"
- elseif self.Tracer == 2 then
- TracerName = "AirboatGunHeavyTracer"
- else
- TracerName = "Tracer"
- end
- local bullet = {}
- bullet.Num = num_bullets
- bullet.Src = self.Owner:GetShootPos() -- Source
- bullet.Dir = self.Owner:GetAimVector() -- Dir of bullet
- bullet.Spread = Vector(aimcone, aimcone, 0) -- Aim Cone
- bullet.Tracer = 3 -- Show a tracer on every x bullets
- bullet.TracerName = TracerName
- bullet.Force = damage * 0.25 -- Amount of force to give to phys objects
- bullet.Damage = damage
- bullet.Callback = function(attacker, tracedata, dmginfo)
- if tracedata:IsPlayer() and math.random(1,10) < 2 then
- tracedata:Ignite(2)
- end
- return self:RicochetCallback(0, attacker, tracedata, dmginfo)
- end
- self.Owner:FireBullets(bullet)
- -- if SERVER and !self.Owner:IsNPC() then
- -- local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0)
- -- self.Owner:ViewPunch(anglo)
- -- local eyes = self.Owner:EyeAngles()
- -- eyes.pitch = eyes.pitch + anglo.pitch
- -- eyes.yaw = eyes.yaw + anglo.yaw
- -- if game.SinglePlayer() then self.Owner:SetEyeAngles(eyes) end
- -- end
- local anglo1 = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0)
- self.Owner:ViewPunch(anglo1)
- if SERVER and game.SinglePlayer() and !self.Owner:IsNPC() then
- local offlineeyes = self.Owner:EyeAngles()
- offlineeyes.pitch = offlineeyes.pitch + anglo1.pitch
- offlineeyes.yaw = offlineeyes.yaw + anglo1.yaw
- if GetConVar("M9KDynamicRecoil"):GetBool() then
- self.Owner:SetEyeAngles(offlineeyes)
- end
- end
- if CLIENT and !game.SinglePlayer() and !self.Owner:IsNPC() then
- local anglo = Angle(math.Rand(-self.Primary.KickDown,-self.Primary.KickUp), math.Rand(-self.Primary.KickHorizontal,self.Primary.KickHorizontal), 0)
- local eyes = self.Owner:EyeAngles()
- eyes.pitch = eyes.pitch + (anglo.pitch/3)
- eyes.yaw = eyes.yaw + (anglo.yaw/3)
- if GetConVar("M9KDynamicRecoil"):GetBool() then
- self.Owner:SetEyeAngles(eyes)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement