Forum

> > CS2D > Scripts > flashlight command
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch flashlight command

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt flashlight command

Powermonger
User Off Offline

Zitieren
Just a little question.

I don't know how to use the flashlight command.

Here's my little example:

1
2
3
4
5
6
7
8
addhook("flashlight","admins")
function admins(id)
   if state==1 then
      parse("speedmod "..id.." 50")
   elseif state==0 then
      parse("speedmod "..id.." 0")
   end
end

I think you'll figure out what I am trying to do.

Please post me an answer when you have time.
Thank you very much.

alt Re: flashlight command

DC
Admin On Online

Zitieren
You are using the variable "state" which has not been declared in your code snippet.
cs2d lua hook flashlight

it must be
1
function admins(id,state)

remember: only function parameters which are actually part of the function that you declare are available as variable in your script!

alt Re: flashlight command

Powermonger
User Off Offline

Zitieren
Oh dam, I forgot to put it there, my bad.

... but it wont still work.

There must be something else wrong.

Has somebody made a script that uses the flashlight hook?
I just put that "F for extra speed" for example.

alt Re: flashlight command

KimKat
GAME BANNED Off Offline

Zitieren
In addition to this command you could write a alias to enable the Flashlight. Which I made a long time ago, here it is.

1
alias "flashlight" "bind f flashlight"

I think that's the code for it, this will basically trigger the flashlight on/off when you press F on your keyboard, you could change this key to any key. I remember that in a previous release of CS2D the flashlight didn't work properly for me so I wrote this alias as a quick workaround. It's useful now too aswell because you can trigger the flashlight on/off with more than two keys.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht