Initial commit

This commit is contained in:
pavetr
2026-03-15 14:54:49 +03:00
commit 64f8029c06
4027 changed files with 254888 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
hook.Add("PlayerBindPress", "Hobo sound", function(ply, bind, pressed)
if ply == LocalPlayer() and ply:GetActiveWeapon():IsValid() and string.find(string.lower(bind), "attack2") and ply:GetActiveWeapon():GetClass() == "weapon_bugbait" then
LocalPlayer():ConCommand("_hobo_emitsound")
end
end)

View File

@@ -0,0 +1,35 @@
local sounds = {
{
range = 14,
path = "npc/zombie/zombie_voice_idle"
},
{
range = 6,
path = "npc/zombie/zombie_pain"
},
{
range = 3,
path = "npc/zombie/zombie_alert"
}
}
local function MakeZombieSoundsAsHobo(ply)
if ply:EntIndex() == 0 then
return
end
if not ply.nospamtime then
ply.nospamtime = CurTime() - 2
end
local t = ply:Team()
if not RPExtraTeams[t] or not RPExtraTeams[t].hobo or CurTime() < (ply.nospamtime + 1.3) or (ply:GetActiveWeapon():IsValid() and ply:GetActiveWeapon():GetClass() ~= "weapon_bugbait") then
return
end
ply.nospamtime = CurTime()
local snd = sounds[math.random(1, #sounds)]
ply:EmitSound(snd.path .. math.random(1, snd.range) .. ".wav", 100, 100)
end
concommand.Add("_hobo_emitsound", MakeZombieSoundsAsHobo)