Forum

> > CS2D > Scripts > Flashlight hook issue
Forums overviewCS2D overview Scripts overviewLog in to reply

English Flashlight hook issue

5 replies
To the start Previous 1 Next To the start

old Flashlight hook issue

Infinite Rain
Reviewer Off Offline

Quote
Hey guys.
I got problem with a flashlight hook.

So this is the code:
1
2
3
4
5
addhook("flashlight", "flashlight_hook")
function flashlight_hook(id, state)
	msg(state)
	msg("working")
end
And when I'm toggling the flashlight, it simply does nothing! I checked console, and nothing is there neither.

Tell me, Am I missing something? Or is it just CS2D bug?

old Re: Flashlight hook issue

Happy eyes
User Off Offline

Quote
user Infinite Rain has written
Hey guys.
I got problem with a flashlight hook.

So this is the code:
1
2
3
4
5
addhook("flashlight", "flashlight_hook")
function flashlight_hook(id, state)
	msg(state)
	msg("working")
end
And when I'm toggling the flashlight, it simply does nothing! I checked console, and nothing is there neither.

Tell me, Am I missing something? Or is it just CS2D bug?


As far as I remember, I don't think flashlight hook worked ever, I've always though I just don't know how to use it, but now I see. It's still very intresting why people saw it only now :S

old Re: Flashlight hook issue

DC
Admin Off Offline

Quote
Update on this one: I Just took a look why it doesn't work. I found the reason and fixed it. CS2D tests if a hook is actually used but I checked the spray hook instead of the flashlight hook. Which - of course - doesn't make sense. It was caused by copy&paste and I simply forgot to replace that part.

So if you need a quick-fix: Simply use the cs2d lua hook spray hook (you can even add an empty function to it, doesn't matter) and the cs2d lua hook flashlight hook will work as well.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview