This is the fix that makes it easier to use the loud'n Kill also known as the Silent Sniper Rifle
How did i do it?
Copied and pasted the code from the Rifle
This will work for TTT
please do not take credit
[url]http://www.garrysmod.org/downloads/?a=view&id=134159[/url]
Can you please give me the direct lua file. garrysmod.org is down :(
-snip, oops-
[QUOTE=cocainelobsta;46846908]Can you please give me the direct lua file. garrysmod.org is down :([/QUOTE]
Here's my servers original Loud n' Kill lua which is the fixed one,
add it in "gamemodes\terrortown\entities\weapons\weapon_ttt_loudnkill.lua"
[CODE]
AddCSLuaFile()
SWEP.HoldType = "ar2"
if CLIENT then
SWEP.PrintName = "Loud n' Kill"
SWEP.Author = "Draks & Goupyl"
SWEP.Slot = 2
SWEP.SlotPos = 1
SWEP.IconLetter = "w"
SWEP.Icon = "VGUI/ttt/icon_g3sg1"
end
SWEP.Base = "weapon_tttbase"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.AutoSpawnable = true
SWEP.Kind = WEAPON_HEAVY
SWEP.Primary.Ammo = "357"
SWEP.Primary.Delay = 0.3
SWEP.Primary.Recoil = 2
SWEP.Primary.Cone = 0.0065
SWEP.Primary.Damage = 37
SWEP.Primary.Automatic = true
SWEP.Primary.ClipSize = 20
SWEP.Primary.ClipMax = 40
SWEP.Primary.DefaultClip = 20
SWEP.HeadshotMultiplier = 4
SWEP.AmmoEnt = "item_ammo_357_ttt"
SWEP.ViewModel = "models/weapons/v_snip_g3sg1.mdl"
SWEP.WorldModel = "models/weapons/w_snip_g3sg1.mdl"
SWEP.Primary.Sound = Sound ("Weapon_M4A1.Silenced")
SWEP.IronSightsPos = Vector(0, 0, -15)
SWEP.EquipMenuData = {
type = "Weapon",
model="models/weapons/w_snip_g3sg1.mdl",
desc = "Sniper Silenced."
};
SWEP.AllowDrop = true
SWEP.IsSilent = true
SWEP.PrimaryAnim = ACT_VM_PRIMARYATTACK_SILENCED
SWEP.ReloadAnim = ACT_VM_RELOAD_SILENCED
function SWEP:Deploy()
self.Weapon:SendWeaponAnim(ACT_VM_DRAW_SILENCED)
return true
end
function SWEP:SetZoom(state)
if CLIENT then
return
else
if state then
self.Owner:SetFOV(20, 0.3)
else
self.Owner:SetFOV(0, 0.2)
end
end
end
-- Add some zoom to ironsights for this gun
function SWEP:SecondaryAttack()
if not self.IronSightsPos then return end
if self.Weapon:GetNextSecondaryFire() > CurTime() then return end
bIronsights = not self:GetIronsights()
self:SetIronsights( bIronsights )
if SERVER then
self:SetZoom(bIronsights)
end
self.Weapon:SetNextSecondaryFire( CurTime() + 0.3)
end
function SWEP:PreDrop()
self:SetZoom(false)
self:SetIronsights(false)
return self.BaseClass.PreDrop(self)
end
function SWEP:Reload()
self.Weapon:DefaultReload( ACT_VM_RELOAD );
self:SetIronsights( false )
self:SetZoom(false)
end
function SWEP:Holster()
self:SetIronsights(false)
self:SetZoom(false)
return true
end
if CLIENT then
local scope = surface.GetTextureID("sprites/scope")
function SWEP:DrawHUD()
if self:GetIronsights() then
surface.SetDrawColor( 0, 0, 0, 255 )
local x = ScrW() / 2.0
local y = ScrH() / 2.0
local scope_size = ScrH()
-- crosshair
local gap = 80
local length = scope_size
surface.DrawLine( x - length, y, x - gap, y )
surface.DrawLine( x + length, y, x + gap, y )
surface.DrawLine( x, y - length, x, y - gap )
surface.DrawLine( x, y + length, x, y + gap )
gap = 0
length = 50
surface.DrawLine( x - length, y, x - gap, y )
surface.DrawLine( x + length, y, x + gap, y )
surface.DrawLine( x, y - length, x, y - gap )
surface.DrawLine( x, y + length, x, y + gap )
-- cover edges
local sh = scope_size / 2
local w = (x - sh) + 2
surface.DrawRect(0, 0, w, scope_size)
surface.DrawRect(x + sh - 2, 0, w, scope_size)
surface.SetDrawColor(255, 0, 0, 255)
surface.DrawLine(x, y, x + 1, y + 1)
-- scope
surface.SetTexture(scope)
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawTexturedRectRotated(x, y, scope_size, scope_size, 0)
else
return self.BaseClass.DrawHUD(self)
end
end
function SWEP:AdjustMouseSensitivity()
return (self:GetIronsights() and 0.2) or nil
end
end[/CODE]
Sorry, you need to Log In to post a reply to this thread.