AddCSLuaFile()
if CLIENT then
SWEP.PrintName = "AK47"
SWEP.Author = "DarkRP Developers"
SWEP.Slot = 3
SWEP.SlotPos = 0
SWEP.IconLetter = "b"
killicon.AddFont("weapon_ak472", "CSKillIcons", SWEP.IconLetter, Color(255, 80, 0, 255))
end
SWEP.Base = "weapon_cs_base2"
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.Category = "DarkRP (Weapon)"
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/cstrike/c_rif_ak47.mdl"
SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.HoldType = "ar2"
SWEP.Primary.Sound = Sound("Weapon_AK47.Single")
SWEP.Primary.Recoil = 1.0
SWEP.Primary.Damage = 200
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.0001
SWEP.Primary.ClipSize = 30
SWEP.Primary.Delay = 0.12
SWEP.Primary.DefaultClip = 90
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "smg1"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.IronSightsPos = Vector(0, -2, 2)
SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.MultiMode = true
SWEP.DarkRPBased = false
function SWEP:DrawHUD()
draw.DrawText("+", "TargetID", ScrW() * 0.5, ScrH() * 0.5, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER)
end
local function BulletCallback(att, tr, dmg)
if ValidEntity(att) then
local dist = (tr.HitPos - tr.StartPos):Length()
if dist > (70 * (512 / 9.75)) then
dmg:ScaleDamage(0.3)
elseif dist > (10 * (512 / 9.75)) then
dmg:ScaleDamage(200 - ((133 / 60) * (dist / (512 / 9.75))))
elseif dist > 0 then
dmg:ScaleDamage(1)
end
end
end
darkrp ak47