mirror of
https://github.com/SpaxscE/LunasFlightSchool.git
synced 2025-03-04 03:13:27 -05:00
add volumechanger
This commit is contained in:
parent
13b1c81307
commit
66e323a7a9
@ -145,6 +145,33 @@ if SERVER then
|
||||
return
|
||||
end
|
||||
|
||||
local LFSSoundList = {}
|
||||
hook.Add( "EntityEmitSound", "!!!lfs_volumemanager", function( t )
|
||||
if t.Entity.LFS then
|
||||
local SoundFile = t.SoundName
|
||||
|
||||
if LFSSoundList[ SoundFile ] == true then
|
||||
t.Volume = t.Volume * LVS.EngineVolume
|
||||
|
||||
return true
|
||||
|
||||
elseif LFSSoundList[ SoundFile ] == false then
|
||||
return false
|
||||
|
||||
else
|
||||
local File = string.Replace( SoundFile, "^", "" )
|
||||
|
||||
local Exists = file.Exists( "sound/"..File , "GAME" )
|
||||
|
||||
LFSSoundList[ SoundFile ] = Exists
|
||||
|
||||
if not Exists then
|
||||
print("[LVS] '"..SoundFile.."' not found. Soundfile will not be played and is filtered for this game session to avoid fps issues.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
list.Set( "ContentCategoryIcons", "[LVS] - Flight School", "icon16/lfs.png" )
|
||||
list.Set( "ContentCategoryIcons", "[LFS]", "icon16/lfs.png" )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user