AddCSLuaFile()
SWEP.ViewModel = Model("models/weapons/c_arms.mdl")
SWEP.WorldModel = ""
SWEP.ViewModelFOV = 54
SWEP.UseHands = true
SWEP.isDroppable = false
SWEP.Author = "Scott"
SWEP.Contact = "N/A"
SWEP.Purpose = "N/A"
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 = true
SWEP.Secondary.Ammo = "none"
SWEP.Category = "HRP Sweps"
SWEP.PrintName = "Bandage"
SWEP.Slot = 5
SWEP.SlotPos = 1
SWEP.Base = "weapon_base"
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.Distance = 256
SWEP.Delay = 2
function SWEP:Initialize()
self:SetHoldType( "fist" )
end
function SWEP:PrimaryAttack()
local max = self.Owner:GetMaxHealth()
local amount = 20 * (self.Owner:GetNWInt("intelligence") / maxSkillCount:GetInt())
local newHealth = self.Owner:Health() + amount
if newHealth > max then newHealth = max end
self.Owner:SetHealth(newHealth)
self:Remove()
end
function SWEP:SecondaryAttack()
return false
end
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.PrintName = "HRP Gun Base"
SWEP.Base = "weapon_base"
SWEP.m_WeaponDeploySpeed = 1
SWEP.Author = "Arron (Karutoh) David Nelson"
SWEP.Contact = "Red-XIII@outlook.com"
SWEP.ViewModel = "models/weapons/c_357.mdl"
SWEP.WorldModel = "models/weapons/w_357.mdl"
SWEP.Slot = 0
SWEP.SlotPos = 10
SWEP.m_bPlayPickupSound = true
SWEP.aimingDownSights = false
SWEP.sightPos = Vector(-4.7, 0, 0.7)
SWEP.sightAng = Angle(-0.2, 0, -0.17)
SWEP.sightFOV = 40
SWEP.hipPos = Vector(0, 0, 0)
SWEP.hipAng = Angle(0, 0, 0)
SWEP.hipFOV = 62
SWEP.Primary.AttackSound = Sound("Weapon_357.Single")
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"
if SERVER then
SWEP.AutoSwitchFrom = false
SWEP.AutoSwitchTo = true
SWEP.Weight = 5
SWEP.DisableDuplicator = true
end
if CLIENT then
SWEP.Category = "HRP Sweps"
SWEP.Purpose = "To be used as a base for Hardline RP."
SWEP.Instructions = ""
SWEP.ViewModelFlip = false
SWEP.ViewModelFlip1 = false
SWEP.ViewModelFlip2 = false
SWEP.ViewModelFOV = SWEP.hipFOV
SWEP.BobScale = 2
SWEP.SwayScale = 2
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = false
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
SWEP.RenderGroup = RENDERGROUP_OPAQUE
SWEP.SpeechBubbleLid = surface.GetTextureID("weapons/swep")
SWEP.CSMuzzleFlashes = false
SWEP.CSMuzzleX = false
SWEP.AccurateCrosshair = false
SWEP.ScriptedEntityType = "weapon"
SWEP.UseHands = true
function SWEP:CalcViewModelView(vm, oldPos, oldAng, pos, ang)
local vec = self.hipPos
local a = self.hipAng
if self.aimingDownSights then
vec = self.sightPos
a = self.sightAng
end
pos = pos + ang:Right() * vec.x + ang:Forward() * vec.y + ang:Up() * vec.z
ang:RotateAroundAxis(ang:Right(), a.x)
ang:RotateAroundAxis(ang:Forward(), a.y)
ang:RotateAroundAxis(ang:Up(), a.z)
return pos, ang
end
end
function SWEP:PrimaryAttack()
self:EmitSound(self.Primary.AttackSound)
self.Owner:ViewPunch(Angle(-20, 0, 0))
self:ShootBullet(25, 1, 0)
self.Weapon:SetNextPrimaryFire(CurTime() + 0.5)
end
function SWEP:SecondaryAttack()
self.aimingDownSights = !self.aimingDownSights
if CLIENT then
if self.aimingDownSights then
self.ViewModelFOV = self.sightFOV
else
self.ViewModelFOV = self.hipFOV
end
end
self.Weapon:SetNextSecondaryFire(CurTime() + 0.2)
end
AddCSLuaFile()
SWEP.ViewModel = Model( "models/weapons/c_arms.mdl" )
SWEP.WorldModel = ""
SWEP.ViewModelFOV = 54
SWEP.UseHands = true
SWEP.isDroppable = false
SWEP.Author = "Scott"
SWEP.Contact = "N/A"
SWEP.Purpose = "N/A"
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 = true
SWEP.Secondary.Ammo = "none"
SWEP.Category = "HRP Sweps"
SWEP.PrintName = "Handcuffs"
SWEP.Slot = 5
SWEP.SlotPos = 1
SWEP.Base = "weapon_base"
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.Distance = 256
SWEP.Delay = 2
function SWEP:Initialize()
self:SetHoldType( "fist" )
end
function SWEP:PrimaryAttack()
local trace = self.Owner:GetEyeTrace()
local ent = trace.Entity
if ent:GetNWFloat("HRP_handcuffedDelay") != nil && ent:GetNWFloat("HRP_handcuffedDelay") > CurTime() then
return false
end
if !ent:IsPlayer() || trace.StartPos:Distance(trace.HitPos) > self.Distance then return false end
if !ent:GetNWBool("HRP_handcuffed") then
if SERVER then
ent:SetNWBool("HRP_handcuffed", true)
ent:SetNWFloat("HRP_handcuffedDelay", CurTime() + self.Delay)
end
if CLIENT then
self.Owner:PrintMessage(HUD_PRINTTALK, "Player has been cuffed!")
end
if SERVER then
tbl = ent:GetWeapons()
ent:SetNWString("HRP_PlayerCuffedWeapons", createString(tbl))
ent:StripWeapons()
ent:PrintMessage(HUD_PRINTTALK, "You have been handcuffed!")
end
else
if SERVER then
ent:SetNWBool("HRP_handcuffed", false)
ent:SetNWFloat("HRP_handcuffedDelay", CurTime() + self.Delay)
end
if CLIENT then
self.Owner:PrintMessage(HUD_PRINTTALK, "Player has been uncuffed!")
end
if SERVER then
tbl = string.Split(ent:GetNWString("HRP_PlayerCuffedWeapons"), ",")
for i = 1, #tbl do
ent:Give(tbl[i])
end
ent:PrintMessage(HUD_PRINTTALK, "You have been uncuffed and all your weapons have been restored!")
end
end
end
function SWEP:SecondaryAttack()
return false
end
function createString(tbl)
local text = ""
for i = 1, #tbl do
if i == #tbl then
text = text .. tbl[i]:GetClass()
else
text = text .. tbl[i]:GetClass() .. ","
end
end
return text
end
AddCSLuaFile()
SWEP.ViewModel = Model("models/weapons/v_pistol.mdl")
SWEP.WorldModel = Model("models/weapons/w_pistol.mdl")
SWEP.isDroppable = false
SWEP.Author = "Scott"
SWEP.Contact = "N/A"
SWEP.Purpose = "N/A"
SWEP.Primary.ClipSize = 1
SWEP.Primary.DefaultClip = 256
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "256"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"
SWEP.Category = "HRP Sweps"
SWEP.PrintName = "Taser"
SWEP.Slot = 5
SWEP.SlotPos = 1
SWEP.Base = "weapon_base"
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
SWEP.Spawnable = true
SWEP.AdminOnly = true
SWEP.TaserSound = Sound("taser.wav")
SWEP.DropWeapon = true
SWEP.Duration = 15
SWEP.Distance = 256
function SWEP:PrimaryAttack()
local trace = self.Owner:GetEyeTrace()
local ent = trace.Entity
if ent:IsWorld() || (!ent:IsPlayer() && !ent:IsNPC()) || trace.StartPos:Distance(trace.HitPos) > self.Distance then return false end
if CLIENT then
if(IsFirstTimePredicted())then
local data = EffectData()
data:SetOrigin(trace.HitPos)
data:SetNormal(trace.HitNormal)
data:SetMagnitude(1.3)
data:SetScale(2)
data:SetRadius(1.2)
util.Effect("Sparks", data)
end
end
if CLIENT then return end
self:SetNextPrimaryFire(CurTime() + 5)
self.Owner:EmitSound(self.TaserSound)
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self.Owner:SetAnimation(PLAYER_ATTACK1)
if ent:IsWorld() then return end
local dist = trace.StartPos:Distance(trace.HitPos)
if ent:IsNPC() then
if ent:GetNWBool("HRP_tased") then return end
if dist > self.Distance then return end
ent:SetNWBool("HRP_tased", true)
local weapon = ent:GetActiveWeapon()
ent:TakeDamage(0, self.Owner, self)
weapon:SetNextPrimaryFire(CurTime() + self.Duration)
local ragdoll = ents.Create("prop_ragdoll")
ragdoll:SetPos(ent:GetPos())
ragdoll:SetAngles(ent:GetAngles())
ragdoll:SetModel(ent:GetModel())
ragdoll:SetVelocity(ent:GetVelocity())
ragdoll:Spawn()
ragdoll:Activate()
ent:SetParent(ragdoll)
ent:SetNoDraw(true)
timer.Simple(self.Duration, function()
ent:SetParent()
ent:Spawn()
local pos = ragdoll:GetPos()
pos.z = pos.z + 10
ent:SetPos(pos)
ragdoll:Remove()
weapon:SetNextPrimaryFire(CurTime())
ent:SetNoDraw(false)
ent:SetNWBool("HRP_tased", false)
end)
end
if ent:IsNPC() then return end
if ent:IsPlayer() then
if ent:GetNWBool("HRP_tased") then return end
if dist > self.Distance then return end
local weapon = ent:GetActiveWeapon()
ent:SetNWBool("HRP_tased", true)
ent:ViewPunch( Angle(-10, 0, 0))
ent:PrintMessage(HUD_PRINTTALK, "You have been tased, you will be disabled temporarily")
ent:TakeDamage(0, self.Owner, self)
if(self.DropWeapon) then
ent:DropWeapon(ent:GetActiveWeapon())
end
weapon:SetNextPrimaryFire(CurTime() + self.Duration)
ent:EmitSound(Sound("player/pl_pain" .. math.random(5, 7) .. ".wav"))
ent:DrawViewModel(false)
local ragdoll = ents.Create("prop_ragdoll")
ragdoll:SetPos(ent:GetPos())
ragdoll:SetAngles(ent:GetAngles())
ragdoll:SetModel(ent:GetModel())
ragdoll:SetVelocity(ent:GetVelocity())
ragdoll:Spawn()
ragdoll:Activate()
ent:SetParent(ragdoll)
ent:ScreenFade(SCREENFADE.IN, Color(230, 230, 230), 0.7, 1.4)
ent:Spectate(OBS_MODE_CHASE)
ent:SpectateEntity(ragdoll)
if timer.Exists("TaserTimer") then timer.Destroy("TaserTimer") end
timer.Simple(self.Duration, function()
ent:UnSpectate()
ent:SetParent()
ent:Spawn()
local pos = ragdoll:GetPos()
pos.z = pos.z + 10
ent:SetPos(pos)
ragdoll:Remove()
ent:DrawViewModel(true)
if IsValid(weapon) then
weapon:SetNextPrimaryFire(CurTime())
end
ent:SetNWBool("HRP_tased", false)
end)
end
end
function SWEP:SecondaryAttack()
return false
end