Forum

> > CS2D > Scripts > Flashlight hook issue
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Flashlight hook issue

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Flashlight hook issue

Infinite Rain
Reviewer Off Offline

Zitieren
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?

alt Re: Flashlight hook issue

Happy eyes
User Off Offline

Zitieren
user Infinite Rain hat geschrieben
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

alt Re: Flashlight hook issue

DC
Admin Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht