Turning off an effect

Hi,

I have a snow effect which automatically turns on with this function:

[lua]function func()
util.Effect((“snow_light”), EffectData());
end
hook.Add(“PostDrawEffects”, “func”, func)[/lua]

How can I make it so the effect can be toggled?



local SnowConvar = CreateConVar( "cl_snow", "1", { FCVAR_ARCHIVE } )
hook.Add("PostDrawEffects", "Snow", function()
if SnowConvar:GetBool()
util.Effect(("snow_light"), EffectData());
end
end)


That should make you able, to toggle it.

Doesn’t toggle still.

Well, then try:



local SnowConvar = CreateConVar( "cl_snow", "1", { FCVAR_ARCHIVE } )
hook.Add("PostDrawEffects", "Snow", function()
if SnowConvar:GetBool() then
util.Effect(("snow_light"), EffectData());
else
hook.Remove("PostDrawEffects", "Snow")
end
end)


Just so you know, you need to type cl_snow “0” in console to deactivate snow.
Also, you maybe have to rejoin.

hook.Remove(“PostDrawEffects”, “Snow”) ?

This is, by far, the stupidest thing that’s ever been done to a forum. I can’t click on anything on the homepage. Do you have any idea how much of a bother I went through just to type this one, single post?

And the “answers” here don’t help any either. What am I supposed to do with that code thing? Type it in Word? Enter it in the internet address bar? Submit it to a superior and wait for 6 to 8 weeks for an answer?

I honestly hope that an admin is reading this, because maybe then you’ll realise howmuch you’ve ****ed up this forum.

How is this related to the thread?