zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_gunturret/cl_init.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

46 lines
1,013 B
Lua

INC_CLIENT()
SWEP.DrawCrosshair = false
SWEP.Slot = 4
SWEP.SlotPos = 0
function SWEP:DrawHUD()
if GetConVar("crosshair"):GetInt() ~= 1 then return end
self:DrawCrosshairDot()
end
function SWEP:Deploy()
self.IdleAnimation = CurTime() + self:SequenceDuration()
return true
end
function SWEP:DrawWorldModel()
end
SWEP.DrawWorldModelTranslucent = SWEP.DrawWorldModel
function SWEP:PrimaryAttack()
end
function SWEP:DrawWeaponSelection(x, y, w, h, alpha)
self:BaseDrawWeaponSelection(x, y, w, h, alpha)
end
function SWEP:Think()
if self:GetOwner():KeyDown(IN_ATTACK2) then
self:RotateGhost(FrameTime() * 60)
end
if self:GetOwner():KeyDown(IN_RELOAD) then
self:RotateGhost(FrameTime() * -60)
end
end
local nextclick = 0
function SWEP:RotateGhost(amount)
if nextclick <= RealTime() then
surface.PlaySound("npc/headcrab_poison/ph_step4.wav")
nextclick = RealTime() + 0.3
end
RunConsoleCommand("_zs_ghostrotation", math.NormalizeAngle(GetConVar("_zs_ghostrotation"):GetFloat() + amount))
end