Jump to content

addCommandHandler to bindKey


dragonofdark

Recommended Posts

Hello,

I have a script to switch vehicles indicators on/off. But to in this script, I must do /indicator_left or /indicator_right to switch them.

It's boring to do every time the command to switch them so I would like to make some binds to switch them.

So the old commands are

addCommandHandler('indicator_left', function () switchIndicatorState('left') end, false) 
addCommandHandler('indicator_right', function () switchIndicatorState('right') end, false) 

And the new commands are

bindKey ( player, ",", "down", function () switchIndicatorState('left') end, false ) 
bindKey ( player, ".", "down", function () switchIndicatorState('right') end, false ) 

But nothing work :S

Could you help me on this ?

PS:

The "," is coma and the "." is dot.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...