if SERVER then AddCSLuaFile("shared.lua") SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false end if CLIENT then SWEP.DrawAmmo = true SWEP.DrawCrosshair = true SWEP.ViewModelFOV = 65 SWEP.ViewModelFlip = true SWEP.CSMuzzleFlashes = true SWEP.PrintName = "USPMP 10" SWEP.Slot = 0 SWEP.Slotpos = 0 SWEP.IconLetter = "a" SWEP.IconFont = "CSSelectIcons" surface.CreateFont("csd", ScreenScale(30), 500, true, true, "CSKillIcons") surface.CreateFont("csd", ScreenScale(60), 500, true, true, "CSSelectIcons") function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha ) draw.SimpleText( self.IconLetter, self.IconFont, x + wide/2, y + tall*0.2, Color( 15, 20, 200, 255 ), TEXT_ALIGN_CENTER ) end end SWEP.Author = "Rambo_6" SWEP.Contact = "" SWEP.Purpose = "" SWEP.Instructions = "" SWEP.Spawnable = false SWEP.AdminSpawnable = false SWEP.Primary.Sound = Sound("Weapon_AK47.Single") SWEP.Primary.Recoil = 1.5 SWEP.Primary.Damage = 40 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.02 SWEP.Primary.Delay = 0.15 SWEP.Primary.ClipSize = 1 SWEP.Primary.DefaultClip = 1 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "none" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" function SWEP:GetMaxAmmo() return self.Primary.ClipSize end function SWEP:Initialize() if SERVER then self:SetWeaponHoldType(self.HoldType) end end function SWEP:Reload() self.Weapon:DefaultReload(ACT_VM_RELOAD) end function SWEP:Deploy() self.Weapon:SendWeaponAnim(ACT_VM_DRAW) return true end function SWEP:Think() end function SWEP:PrimaryAttack() self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay) if not self:CanPrimaryAttack() then return end self.Weapon:EmitSound(self.Primary.Sound,100,math.random(98,102)) self:ShootBullets(self.Primary.Damage, self.Primary.NumShots, self.Primary.Cone) self:TakePrimaryAmmo(1) self.Owner:ViewPunch(Angle(math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0)) //if CLIENT then //self.Weapon:SetNetworkedFloat("LastShootTime", CurTime()) //end end function SWEP:ShootBullets( damage, numbullets, aimcone) local bullet = {} bullet.Num = numbullets bullet.Src = self.Owner:GetShootPos() bullet.Dir = self.Owner:GetAimVector() bullet.Spread = Vector( aimcone, aimcone, 0 ) bullet.Tracer = 5 bullet.Force = 11 bullet.Damage = damage bullet.AmmoType = "Pistol" bullet.TracerName = "Tracer" bullet.Callback = function ( attacker, tr, dmginfo ) if tr.Entity:IsValid() then if string.find(tr.Entity:GetClass(), "vehicle_") or string.find(tr.Entity:GetClass(), "beacon") then dmginfo:ScaleDamage(self.Primary.VehDamageScale) end end end self.Owner:FireBullets( bullet ) self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) // View model animation self.Owner:MuzzleFlash() // Crappy muzzle light self.Owner:SetAnimation( PLAYER_ATTACK1 ) // 3rd Person Animation end function SWEP:GetViewModelPosition(pos, ang) return pos, ang end function SWEP:SecondaryAttack() end