Peeking sound effect

This commit is contained in:
Darsu 2024-08-28 10:22:11 +07:00
parent e7a6361d3a
commit 276384aea1
3 changed files with 20 additions and 0 deletions

View File

@ -5,6 +5,19 @@ local lastpressed = false
local arc9_togglepeek_reset = GetConVar("arc9_togglepeek_reset")
local arc9_togglepeek = GetConVar("arc9_togglepeek")
local soundin = {
name = "firemode",
sound = "arc9/cloth_5.ogg",
channel = ARC9.CHAN_FIDDLE,
volume = 0.3,
}
local soundout = {
name = "firemode",
sound = "arc9/cloth_4.ogg",
channel = ARC9.CHAN_FIDDLE,
volume = 0.3,
}
function SWEP:ThinkPeek()
if !self.dt.InSights then return end
@ -14,10 +27,17 @@ function SWEP:ThinkPeek()
if arc9_togglepeek:GetBool() then
if binding and !lastpressed then
self.Peeking = !self.Peeking
self:PlayTranslatedSound(self.Peeking and soundout or soundin)
end
else
self.Peeking = binding
if binding != lastpressed then
self:PlayTranslatedSound(self.Peeking and soundout or soundin)
end
end
lastpressed = binding
end

BIN
sound/arc9/cloth_4.ogg Normal file

Binary file not shown.

BIN
sound/arc9/cloth_5.ogg Normal file

Binary file not shown.