mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
29
lua/weapons/arccw_base/sh_util.lua
Normal file
29
lua/weapons/arccw_base/sh_util.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
function SWEP:TableRandom(table)
|
||||
return table[math.random(#table)]
|
||||
end
|
||||
|
||||
function SWEP:MyEmitSound(fsound, level, pitch, vol, chan, useWorld)
|
||||
if !fsound then return end
|
||||
|
||||
fsound = self:GetBuff_Hook("Hook_TranslateSound", fsound) or fsound
|
||||
|
||||
if istable(fsound) then fsound = self:TableRandom(fsound) end
|
||||
|
||||
if fsound and fsound != "" then
|
||||
if useWorld then
|
||||
sound.Play(fsound, self:GetOwner():GetShootPos(), level, pitch, vol)
|
||||
else
|
||||
self:EmitSound(fsound, level, pitch, vol, chan or CHAN_AUTO)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user