Sound.wav not precaching !!! (HELP GUYS PLZ !! )

Hello guys!

I have a big problem, my addon is not precaching sounds… (so no one can hear them…)
here is a part of my addon:

[lua]

local sndPowerDown = Sound(“weapons/sil1.wav”)

function SWEP:Initialize()

util.PrecacheSound("weapons/sil1.wav")

nextshottime = CurTime()
self:SetWeaponHoldType( "pistol" )
self.zoomed = false

end

function SWEP:PrimaryAttack()

self.Weapon:EmitSound( sndPowerDown )

end

[/lua]

When i go to my server, the sound “weapons/sil1.wav” is not precaching, so players can’t hear the sound!
How can i make the server to precache the sound? so everyone can hear it!?

You don’t need to precache the sound. Sound( “” ) already does that so you don’t really need to precache it again in SWEP:Initialize(). I don’t see why it’s not precaching though, it looks fine to me. Anyone else have any ideas?

But when i do that, the sound is not precaching, when i try to delete it from my gmod game, and i go to my own server, it’s not downloading ! dude :frowning: please… help me :’(

Are you actually giving it to the players to download? Are you using resource.AddFile( “sound/weapons/sill.wav” ) serverside?

where should i add this:? resource.AddFile( “sound/weapons/sill.wav” )

in my plugin??

[editline]26th June 2014[/editline]

If i add this to my : lua/autorun/server/precache.lua:
[lua]

if (SERVER) then

resource.AddFile( “sound/weapons/sil1.wav” )
resource.AddFile( “materials/cable/hose_orange1.vmt” )
resource.AddFile( “materials/cable/hose_black1.vmt” )
end

[/lua]

Will it works??

Move that file to lua/autorun.