Forum

> > CS2D > Scripts > flashlight command
Forums overviewCS2D overview Scripts overviewLog in to reply

English flashlight command

4 replies
To the start Previous 1 Next To the start

old flashlight command

Powermonger
User Off Offline

Quote
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.

old Re: flashlight command

DC
Admin Off Offline

Quote
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!

old Re: flashlight command

Powermonger
User Off Offline

Quote
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.

old Re: flashlight command

KimKat
GAME BANNED Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview